473,385 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

socket and virtual host

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).ToS tring(), 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....

Oct 26 '06 #1
1 1792
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


Steph wrote:
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).ToS tring(), 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....
Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Droopy | last post by:
Hi, I try to implement a reusable socket class to send and receive data. It seems to work but I have 2 problems : 1) I rely on Socket.Available to detect that the connection is closed (no...
7
by: | last post by:
Hi all, I have a simple .aspx page running on net 2.0 that is trying to do a http post to a remote server. Here is the code Private Function ProcessRequests(ByVal strbody As String) As String...
9
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame....
5
by: zxo102 | last post by:
Hi, I am doing a small project using socket server and thread in python. This is first time for me to use socket and thread things. Here is my case. I have 20 socket clients. Each client send a...
1
by: mirandacascade | last post by:
I noticed the following lines from the connect() method of the HTTPConnection class within httplib: for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype,...
1
by: xreload | last post by:
Hello ! I have some class for getting html documents : """ Wrapper for Python sockets lib """ import socket import urlparse import random
14
by: ahlongxp | last post by:
Hi, everyone, I'm implementing a simple client/server protocol. Now I've got a situation: client will send server command,header paires and optionally body. server checks headers and decides...
6
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both...
10
by: Hendrik van Rooyen | last post by:
While doing a netstring implementation I noticed that if you build a record up using socket's recv(1), then when you close the remote end down, the recv(1) hangs, despite having a short time out...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.