How can I make my Socket server to work on WAN?

122 Views Asked by At

I am creating a multiplayer game using Unity Game Engine. I created my server using Socket in C#.

My server works fine on the LAN, however it doesn't work on the WAN. I learned that I need to configure port forwarding in order to make it work on the WAN. I am using a Tp-Link router, and I found a great video that helped me to setup port forwarding:

https://www.youtube.com/watch?v=2tIUts0fyFk

Things I adjusted on my own:

  1. In the video, the person used HTTP, but I chose DNS for my Socket server. I don't really know what I should choose here.

The service type

  1. On the client side, I changed the server IP from the IP reported by ipconfig to my router's static IP, and the server port to the port I chose while setting up port forwarding.

The ip I am using in client side code

  1. On the server side, I put the IP reported by ipconfig as the server IP. This is the same IP I chose as my DHCP OPTION.

MY DHCP SECTION IP

I am using the UDP protocol for my game, and as I said it is working fine in my LAN network.

My problem is, even after all this, my game is not working on the WAN. I also made sure that my WAN client has his Windows Defender firewall turned off. It didn't work.

0

There are 0 best solutions below