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 described features in one-file standalone binaries made with Starpack technology. This is the moment where the full power of Tcl can be easily seen—just stop for a moment and reflect—how many languages do you know that offer you the possibility to freely embed a web server? And how many of them will let you easily pack your entire app into one exe file, for a wide set of platforms? And in how many cases the resulting file will be around 3 MB of size? Not many? Well, now there is one more.

Now that you have learned the solid basics of the TclHttpd, you are ready for the the next chapter, which will introduce you to the server in more detail, with a particular focus on client-server programming.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.67.16