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.