Forgive this question, I'm a designer trying to get my head around a possible network architecture. I have a wildcard domain on example.com. The client connects via TCP to foo.example.com:1234. Is it possible for the process that is handling the connection to be aware of which subdomain the client connected to?

Just to be more clear:

Client -[packet]-> foo.example.com:1234 -[host,packet]-> server1.internal

My thought was I could use HAProxy to route requests to the correct machine, but because it's not HTTP I'm not sure if I can get the subdomain from the incoming packets. Any help would be appreciated.


I assume you can't give the subdomains different IP addresses. In which case, unless the protocol (way above the TCP layer) supports sending hostnames like HTTP does, the answer is no.

If you can choose different IP addresses for each subdomain, then that is your answer.

  • I was afraid this would be the case. Thanks for confirming it for me anyway. – Chris Lloyd May 14 '11 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.