socket and virtual host

  • Thread starter Thread starter Steph
  • Start date Start date
S

Steph

eh eh.. a little problem...
i need open a HTTP socket to a server with a lot of virtual hosts...

this.ipHost = "www.domainA.com";
IPHostEntry ihe = Dns.GetHostEntry(this.ipHost);
IPAddress.TryParse(ihe.AddressList.GetValue(0).ToString(), out IPAddress);
ipHost2 = IPAddress.ToString();

!!!!! ep = new IPEndPoint(IPAddress.Parse(ipHost2), this.ipPort); !!!!!!!!!
not good, because, when a ask a page, the server return a erro 404 - cause
: the page is not in IPAddress but in the domaine (www.domainA.com)

"
POST /test.html HTTP/1.1
Host: www.domainA.com
Content-type:application/x-www-form-urlencoded
Accept: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.12)
Gecko/20050919 Firefox/1.0.7
Connection: Close
Cookie:moncook=justatest
Content-length: 37
"
the test.html page is not found....
 
Your HTTP 1.1 request has to contain the FQ domain name you're looking
for, otherwise the server is going to assume that you're querying
against the "default" virtual server, if one is installed.

Take a look at the HTTP 1.1 spec for more details.



Stephan
 
Back
Top