Hello everyone!,
I am trying to create a host from 2 PC with different networks (Online), and I cannot make a connection, on the other hand, with 2 PCs that are within the same network I have no problem.
I am using my public IP and I have tried with 2 different ports, 7777, and 4380, but it does not work with any of them.
I don’t know what I can be doing wrong, any advice will help me, thanks.
You need to setup port forwarding. Your public IP is that of the router. But the router isn‘t running the netcode app. Therefore requests to the given port need to be forwarded to your machine‘s local IP.
I understand that I need to open ports as you tell me, but, for example, in the Pico Park game you can play with friends Online and I never had to open ports, how do you make it work without opening ports?
The magic ingredient for this is called a relay server. That way there are no direct connections between host and client but all clients and the host actually connect to the relay server, so for everyone involved the connections are only outgoing, not incoming.