Summary
After this chapter, you should be familiar with the concepts of web programming, by which we understand a set of topics related to HTTP protocol and HTML language.
First we presented how to use Tcl code as legacy CGI scripts. This application can be significantly improved with ncgi
package. We also presented a convenient way of generating HTML documents using the html
package.
Having laid the basics, we focused on TclHttpd
, a mature web server implemented entirely in Tcl. We discussed its various aspects, starting from serving the static content and cooperation with CGI scripts. Then we presented advanced concepts like creating handlers of a specific document type, which can alter the content returned to the client; mapping Tcl procedures to a URL, so that the HTTP query parameters are simultaneously the arguments for that procedure; and handling an entire sub-domain with delegated code. We also mentioned items related to security and debugging.
Finally, we presented how to use all...