Server Build - Hosting On Local Machine W/ Internet Traffic

Now if you are hosting on a machine in your local network that you want to allow internet connections to, first follow the setup for Local Network Connections. This will make sure your machine is setup correctly.

With your machine setup correctly now you MUST port-forward your router to the machine that is hosting the server build. This basically tells your router that any internet traffic that is connecting to your router's IP on a certain port will automatically get forwarded to the machine on your local network that is hosting the server build.

All routers are different but you can lookup your specific model and how to port-forward that specific model of router on port-forward.com.

Connection Timeout/Connection Denied

If you first verified you can connect locally, then make sure your ISP allows you to host things like this. Sometimes ISP's will prevent traffic from purposefully connecting to a target router.

Example Port-Forward

I'm using KCP Transport with the following: Port: 7777

If I setup my EMI_NetworkManager component to use the KCP transport (which uses UDP traffic instead of TCP traffic - have a look at Mirrors documentation on all the available transports and what protocol they make use of) I would launch the server build on my machine. Next I would go to my router and make sure that the IP assignment is set to static, which means it will ALWAYS assign the same IP to my target machine. This way I will not need to keep updating my port fowarding. Then go to my port foward rules and add the following:

Forward Port: 7777 To: <my_machines_ip>:7777

You can forward any port you want, but it must always go to your machines IP on the port that your KCP transport is setup on.

Next get your routers public IP address (again this is best if its a static IP and not a dynamic one) by simply going to google and typing Whats My Ip and it will display your public IP address in google. Clients will then connect to:

<your_routers_public_ip>:<your_forwarded_port>