passing code from http to TCL using AOL Server 
Author Message
 passing code from http to TCL using AOL Server

We are pulling our hair out with this one....any help would be appreciated.

We are trying to get a URL to perform an action on the webserver.

For example,  www.testing.com/username   will direct the webserver to pull
the index.html file in the /username directory.

How do I get the web server to pass "username" through to a TCL module to
pull a dynamic page from the server.  I have 10,000 users for which I would
like to create "virtual web pages" for.  Is this even possible with AOL
Server & TCL.  Or must I use TCL Server for it's embeddable server
functionality?

Thanks for any assistance,

Cannon Ghelani



Wed, 03 Jul 2002 03:00:00 GMT  
 passing code from http to TCL using AOL Server

Quote:

> We are trying to get a URL to perform an action on the webserver.

> For example,  www.testing.com/username   will direct the webserver to pull
> the index.html file in the /username directory.

> How do I get the web server to pass "username" through to a TCL module to
> pull a dynamic page from the server.  I have 10,000 users for which I would
> like to create "virtual web pages" for.  Is this even possible with AOL
> Server & TCL.  Or must I use TCL Server for it's embeddable server
> functionality?

Being not too helpful, all I can say is that I know this is possible,
but it depends on how you set up your AOLServer.  Unfortunately, I
only know the feature set, but haven't actually used AOLServer.

--
   Jeffrey Hobbs                          The Tcl Guy
   jeffrey.hobbs at scriptics.com         Scriptics Corp.



Fri, 05 Jul 2002 03:00:00 GMT  
 passing code from http to TCL using AOL Server
Cannon,

Have you looked at Philip Greenspun's book on web publishing (www.photo.net)?
He uses AOLserver 2.x and you might find some useful examples there, especially
under:

    http://www.photo.net/wtr/thebook/server-programming.html

I think you need to use "ns_conn url" (but don't take my word, I have never
used AOLserver).

Hemang.

Quote:

> We are pulling our hair out with this one....any help would be appreciated.

> We are trying to get a URL to perform an action on the webserver.

> For example,  www.testing.com/username   will direct the webserver to pull
> the index.html file in the /username directory.

> How do I get the web server to pass "username" through to a TCL module to
> pull a dynamic page from the server.  I have 10,000 users for which I would
> like to create "virtual web pages" for.  Is this even possible with AOL
> Server & TCL.  Or must I use TCL Server for it's embeddable server
> functionality?

> Thanks for any assistance,

> Cannon Ghelani




Fri, 05 Jul 2002 03:00:00 GMT  
 passing code from http to TCL using AOL Server
I'm just learning AOLserver, but you certainly have access to the
full URL on any dynamic page you implement.  Look up "ns_conn" in
the aolserver documentation (www.aolserver.com) and you can find out
the URL.  You can also write your own URL dispatchers that would
do whatever you want.  It also has more elaborate virtual server support
than TclHttpd.

Quote:
>>>Jeffrey Hobbs said:


 > > We are trying to get a URL to perform an action on the webserver.
 > >
 > > For example,  www.testing.com/username   will direct the webserver to pull
 > > the index.html file in the /username directory.
 > >
 > > How do I get the web server to pass "username" through to a TCL module to
 > > pull a dynamic page from the server.  I have 10,000 users for which I woul
     d
 > > like to create "virtual web pages" for.  Is this even possible with AOL
 > > Server & TCL.  Or must I use TCL Server for it's embeddable server
 > > functionality?
 >
 > Being not too helpful, all I can say is that I know this is possible,
 > but it depends on how you set up your AOLServer.  Unfortunately, I
 > only know the feature set, but haven't actually used AOLServer.
 >
 > --
 >    Jeffrey Hobbs                          The Tcl Guy
 >    jeffrey.hobbs at scriptics.com         Scriptics Corp.


        http://www.scriptics.com
        Scriptics: The Tcl Platform Company



Sat, 06 Jul 2002 03:00:00 GMT  
 passing code from http to TCL using AOL Server

Quote:

> We are pulling our hair out with this one....any help would be appreciated.

> We are trying to get a URL to perform an action on the webserver.

> For example,  www.testing.com/username   will direct the webserver to pull
> the index.html file in the /username directory.

> How do I get the web server to pass "username" through to a TCL module to
> pull a dynamic page from the server.  I have 10,000 users for which I would
> like to create "virtual web pages" for.  Is this even possible with AOL
> Server & TCL.  Or must I use TCL Server for it's embeddable server
> functionality?

You'll want to "attach" a procedure to a URL space. One of two functions
will be useful: ns_register_proc or ns_register_filter. Take a look in
the TCL API docs (eg,
http://www.aolserver.com/server/docs/2.3/html/tcldev.htm)
to read about them.

Basically, from a TCL module (not pages) you'd want to do something
like:

  ns_register_proc GET /userpages/* servePage

where servePage is a TCL proc that dynamically creates and sends the
page.

When usng ns_register_proc, you *must* create a response for the
browser.
If you use ns_register_filter, you have the option of letting AOLserver
perform its default action for the URL. So with:

  ns_register_filter postauth GET /userpages/*  servePage

The proc servePage can check a database for existence of userid or some
such,
and if it doesn't exist, return a code that tells AOLserver to continue
processing
the URL (perhaps another registered filter, or proc, but usually checks
the filesystem). In that way, you could have a mixture of dynamic pages
and static pages on disk in the same URL space. If that was desireable
or needed.

Have fun,

Bob



Mon, 08 Jul 2002 03:00:00 GMT  
 passing code from http to TCL using AOL Server

Quote:

> We are pulling our hair out with this one....any help would be appreciated.

> We are trying to get a URL to perform an action on the webserver.

> For example,  www.testing.com/username   will direct the webserver to pull
> the index.html file in the /username directory.

> How do I get the web server to pass "username" through to a TCL module to
> pull a dynamic page from the server.  I have 10,000 users for which I would
> like to create "virtual web pages" for.  Is this even possible with AOL
> Server & TCL.  Or must I use TCL Server for it's embeddable server
> functionality?

You'll want to "attach" a procedure to a URL space. One of two functions
will be useful: ns_register_proc or ns_register_filter. Take a look in
the TCL API docs (eg,
http://www.aolserver.com/server/docs/2.3/html/tcldev.htm)
to read about them.

Basically, from a TCL module (not pages) you'd want to do something
like:

  ns_register_proc GET /userpages/* servePage

where servePage is a TCL proc that dynamically creates and sends the
page.

When usng ns_register_proc, you *must* create a response for the
browser.
If you use ns_register_filter, you have the option of letting AOLserver
perform its default action for the URL. So with:

  ns_register_filter postauth GET /userpages/*  servePage

The proc servePage can check a database for existence of userid or some
such,
and if it doesn't exist, return a code that tells AOLserver to continue
processing
the URL (perhaps another registered filter, or proc, but usually checks
the filesystem). In that way, you could have a mixture of dynamic pages
and static pages on disk in the same URL space. If that was desireable
or needed.

Have fun,

Bob



Mon, 08 Jul 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. login to web server using http 2.0/Tcl

2. Build https server with Tcl http server?

3. Passing environment variable to HTTP server

4. WebToolkit : Using Front-End HTTP Servers

5. using realbasic to develop a http server

6. Using remote MySQL server with PHP via HTTP

7. Code for dealing with http servers

8. Need advice: serving data using http/web-server to clients ( not only browsers )

9. Simple Sample code for http server and client

10. http://members.aol.com/GBerthume

11. http://member.aol.com/swadjas

12. http://members.aol.com/kennzo/tddl.htm

 

 
Powered by phpBB® Forum Software