Fake UDP packet source address on localhost only

300 views Asked by At

I am working on a way to force the game Alien vs. Predator 2 to connect to specific IP address. The reason is, that quite often the server is reachable, but the UDP broadcast the game sends to discover it do not reach the server.

On localhost, this kind of discovery always works. So what I thought I could do is a simple console application that will listen on UDP broadcast from the game and reply. The reply needs to look like it came from the real server's IP, not localhost.

I figure that with no ISP/firewalls involved, this should be much simpler.

I read Node.JS UDP dgrams documentation. It says how to specify target address and port for a message, but it seems to rely on OS' behavior for filling up the source IP and port.

Is there another way?

1

There are 1 answers

1
LoneDev On

You can try adding a line to your operating system host file:

127.0.0.1 **the_original_game_server_ip**

This will redirect all traffic to localhost instead of the game server. Now just create a console application that listens to the game server port.