On Mon, Apr 22, 2013 at 02:28:26PM +0400, Md Mahbubul Islam wrote: > Hi I am planning to create a sofware load balancer that will sit in front > of many socket servers in linux. The clients will connect to the load > balancer . The load balancer will maintain a table of alternative ips and > their ports. It will connect the client to the best available ip and port > and disconnect itself from the client.Thus it will go out of the scene.In > this condition ony connected devices will be the client and the new socket > server but NOT the load balancer. > > Example : Cleint ip 10.1.2.3 port 1234 > load balancer Ip 10.1.2.4 port 1235 > list of socket servers in Load Balancer: > A Ip 10.1.2.4 port 1236 > B Ip 10.1.2.4 port 1237 > C Ip 10.1.2.5 port 1238 > Now for the 1st request to the load balancer from client, the load > balancer will establish a connection between the client & server A > and disconnect itself from client.
You can't do that using TCP (since you're talking about ports, I'm assuming you mean TCP). However you can do that using UNIX sockets over which you can pass the client's file descriptor. We don't do this yet in haproxy but will soon be able to when the unix connection is implemented. This is sometimes useful when serving large contents such as videos from a static file server. Regards, Willy

