2

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.

EEAA
  • 109,363
  • 18
  • 175
  • 245
Chris Lloyd
  • 123
  • 4

1 Answers1

3

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.

Slartibartfast
  • 3,295
  • 18
  • 16