1 / 8

TclHttpd The Tcl Web Server

TclHttpd The Tcl Web Server. Brent Welch <welch@scriptics.com> www.scriptics.com/tclhttpd ftp.scriptics.com/pub/tcl/httpd. Goals and Experiences. Embeddable, Extensible Web Server Add web interface to your application License server, DHCP server, Mail List Server

rgaines
Download Presentation

TclHttpd The Tcl Web Server

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TclHttpdThe Tcl Web Server Brent Welch <welch@scriptics.com> www.scriptics.com/tclhttpd ftp.scriptics.com/pub/tcl/httpd Tcl/2k Conference, slide 1

  2. Goals and Experiences • Embeddable, Extensible Web Server • Add web interface to your application • License server, DHCP server, Mail List Server • General Purpose Web Server • Page Templates • Built-in form handlers • sunscript.sun.com • www.scriptics.com Tcl/2k Conference, slide 2

  3. Architecture for Extensibility File System Other Process Your Application Template App- Direct CGI Doc URL Dispatch HTTP Protocol Tcl/2k Conference, slide 3

  4. URL Dispatch Implement a URL sub-tree, interpret meaning of URL path Application-Direct Maps a URL to a Tcl Procedure. Maps form data to procedure arguments. Document Templates Procedure calls, variable references inside HTML pages General Doc-Type handlers Authentication hook Architecture for Extensibility Tcl/2k Conference, slide 4

  5. Url Dispatch: Partition Hierarchy /status /resource Url_PrefixInstall prefix command inThread Url_PrefixInstall /resource ResourceDispatch 0 Tcl/2k Conference, slide 5

  6. Direct_Url /status Status proc Status/doc { {pattern *} {sort hits} } { # Display URLs matching $pattern # Sort display by name or hit count return $html } /status/doc?pattern=/images*&sort=name Missing parameters get default value, or “” Return value of proc is the page Set alternate content-types, not just text/html Application-DirectMap URL to Tcl Procedure Tcl/2k Conference, slide 6

  7. Use Tcl to general complex HTML for navigation Put simple calls into pages [scriptics::header “Title” lev1 lev2 lev3] Cache template output in plain .html file Form handlers Embed calls to handle incoming form data “Self-posting forms” repopulate fields, then redirect to the next page when everything is OK Document Templates: HTML+Tcl Tcl/2k Conference, slide 7

  8. 32 K File Fetch Tcl/2k Conference, slide 8

More Related