I've been running a small
game server for a while and want to set up a second one on the same server. The issue is
that these servers don't support domain names; if a request comes in on the right port
(22565)it doesn't matter what domain was being visited unlike say apache with its
vhosts).
So my only option is to setup one game
server on the default port (25565), and the other on another port
(25564).
So to my question: is it possible to
remap a port (in this case 25565 to 25564) if it comes in from a specific domain? (I
have two subdomains both pointing to my server: mc, mcold; and would like to redirect
all traffic sent to 25565 to 25564 if the user came from the subdomain
mcold).
Thanks for any help,
/>Max
Answer
tl;dr:
No.
In order to do this sort of
thing, the game client would need to support it, and it's highly unlikely that it does.
In the case of web serving, the clients (a web browser) send the domain name along in
the HTTP request as a host header. This way, the server knows which domain was
used.
In the case of your game, however, this is
not possible. The clients look up the domain name when they start up and then all
subsequent access is via IP only.
Your best bet
is to see if you can obtain an additional static IP address for the
server.
Comments
Post a Comment