Multiple TCP/HTTP servers with only one IP : how to ?

I have a problem which can probably be solved with some kind of port redirector which can redirect to different locations depending on client request content.

Here is the problem description :

I have one Windows application which is a kind of real-time TCP and HTTP server. In order for the client software to be able to connect to a server on the Internet without problems, the server must listen on ports HTTP (80) and HTTPS (443).

I want to host multiple software servers on the same computer which as only one public IP address. So, for example, if i have 2 software servers on this computer they will need to bind at the same time on ports 80 and 443 of the same public IP. AFAIK this is imposible.

I am currently looking for solutions in order to solve this problem.

One solution i imagine :

Note : The client software can communicate with the server both in TCP and HTTP, so i can use only HTTP in this case.

Make the software servers listen on internal IPs or on another port on the same computer. For example, server1 will listen on 10.1.0.1 and server2 on 10.1.0.2.

This way it is possible to use a reverse proxy which will listen on ports 80 and 443 of the public IP and redirect to the good internal server depending on the client request URL. For example, if the client send a GET

formatting link
request will be interpreted by the reverse proxy which will redirect to server1 on 10.1.10.1.

I tried with different reverse proxies (Apache, Squid, AT32 and a few others), and this always failed.

This failed because when the reverse proxy receive a request, says for

formatting link
it redirects the request to the internal server1, acting itself as the HTTP client. Then it waits to receive BigFile.zip completly before transfering it back to the real client. I suppose this mechanism is used in order to cache the web page for next client requests.

The problem is my application use HTTP to stream data. For the reverse proxy this is like big web pages which will never be complete. So this didn't work.

One solution to this problem will be to use a reverse proxy which does not wait for the internal page to be fully transfered before sending it back to the client. But currently i didn't found one !

They are problably other solutions too, i am open to your suggestions.

Thank you in advance

Reply to
alt250
Loading thread data ...

Thank you for your answer Duane

between servers which can transparently allows server changes during user session.

In my case each server provide a specific service, like 2 differents web sites, and the client want to connect to only one of them and can't change after. In this case, i think there is there is no need for a state server.

Anyway, i will read more about server farming in case this give me an idea to solve my problem.

Reply to
alt250

Hope IPv6 wil one day solve this lack of IP addresses :-)

Unfortunally my software is not a true web server, it just use HTTP to make data transfert. So it didn't have a virtual server feature like Apache or IIS.

The solution i described is something like name based virtual servers, as it give different answers to the user depending on the domain name it demands.

If i can't find a solution, i will probably try to make it myself by writing a program which will listen on ports 80 and 443, check server domain name in the HTTP header and tunnel the connection to the right server.

I am sure something like this already exists somewhere, but i didn't find it :(

Reply to
alt250

From what I understand, it's called Web Server Farming using a State server using stateful sessions between the clients and the Web severs running the same applications on multiple Web servers. The Web server farm control server has the public IP and knows how to keep track of traffic going back to internal IP(s) belonging to the Web servers. The client makes a request of the application on the server and data is sent out. Then the user does a post back and either the post back goes to the original Web server or the control selects another Web server that has the same application. And with the usage of a session state server keeping track of the client sessions, everything is seamless.

This is a .Net solution.

Duane :)

Reply to
Duane Arnold

snipped-for-privacy@gmail.com schrieb im Artikel :

I, too, have just one IP address. Right now there are seven webservers configured and running. All on 80/tcp. The solution was named based virtual webservers. Might be a solution for you, too, yet I'm not sure if your software supports that. A second server instance is running for 443/tcp traffic. When working with named based virtual servers you cannot comine 80/tcp and 443/tcp in one singel webserver instance.

Cheers,

Chris.

Reply to
Chris Kronberg

There is no lack of IP's now. Just lack of residential ISP's willing to provide more than 1 IP to customers for free.

Reply to
Leythos

snipped-for-privacy@gmail.com wrote in news:1114273996.778444.162180 @z14g2000cwz.googlegroups.com:

You can also develop a .Net Windows Desktop application Web based using HTTP over Binary or Soap with a Web Server using Web Services and/or .Net Remoting. A state server is not need in that case.

Duane :)

Reply to
Duane Arnold

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.