Instead of creating my own sockets, etc., I would use httplib . Thus, they will receive data from the http server and analyze the headers in a dictionary for example.
import httplib
conn = httplib.HTTPConnection("www.python.org")
conn.request("GET", "/index.html")
r1 = conn.getresponse()
dict = r1.getheaders()
print(dict)
gives
[('content-length', '16788'), ('accept-range', 'bytes'), ('server', 'Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g mod_wsgi/2.5 Python/2.5.2 '), (' last-modified ',' Mon, 15 Feb 2010 07:30:46 GMT '), (' etag ',' "105800d-4194-47f9e9871d580" '), (' date ',' Mon, 15 Feb 2010 21:34:18 GMT '), (' content-type ',' text/html ')]
.