From: Gary Wright Date: 2007-04-09T08:18:39+09:00 Subject: Re: Trying to GET google with socket....problem On Apr 8, 2007, at 11:57 AM, Hey You wrote: > Also putting the Host header or adding the full > domain to the code such as "GET www.google.ca/index.html" both > specifies > which host we want so I don't see why change them. The URI provided in the GET request can be an absolute URI only if the request is going to a proxy server. In *that* case the GET would look like: GET http://proxy.domain.com/index.html Otherwise the URI must be an absolute path (i.e., a path starting with '/'). In that case the GET would look like: GET /index.html The problem with only having the path is that a web server that is hosting several websites can't determine from the GET request which site the request pertains to. The incoming TCP connections only have a destination IP address, not a destination domain name. The solution to this problem is the "Host:" header. By looking at the "Host:" header, the web server can multiplex several websites at the same IP address. Without the Host: header you would have to have a separate IP address for every website. So your request should be sent as: GET /index.html HTTP/1.0 Host: www.google.ca