Let’s Build a Web Server, Part 3
ruslanspivak.com
ruslanspivak.com
Now that you mentioned WSGI though I'm tempted to write a post on building a client/server over that protocol too (or probably FastCGI instead).
[0] http://notes.eatonphil.com/web-server-basics-http-and-socket...
Once the web server is built, you'll realize that you need to support compressing/decompressing, or piping blobs to some other encoder/decoder.