This works on my system (Just brings back 128 bytes HTTP header). (Note
the extra ‘\n’…
That’s one too many \n’s now. There’s one already at the end of Host:
www.google.com\n, so you only need one more to give the blank line.
But actually, to comply with RFCs, you need to send \r\n at the end of
data = mySock.recv(128)
Quite a few webservers gracefully accept \n, but there are also plenty
strict ones which don’t - including Mongrel I believe.