Listening for packets directed to my WAN IP?

211 Views Asked by At

Currently I'm experimenting with sockets and UDP packets.

I created a UDP socket and binded it to 127.0.0.1, and when sending a UDP packet to 127.0.0.1, the server successfully received it.

But I want to be able to send UDP packets from external locations to my server and receive them. How would I do this?

1

There are 1 best solutions below

3
On

That depends on your network topology and may be more of a question for http://serverfault.com.

Assuming your server is behind a NAT device, i.e. a router, you'd need to configure said device to forward a certain port to your server. Any packet reaching the NAT device on the public IP address on that port will be forwarded to the server as if it had been sent to the server directly.