Kryonet(the library I am using) requires a user to be within the same network or forward their ports to host a game server.
Is there a way so users do not need to port forward while still using kryonet or are there other libraries out there that can fufill this task?
This free service allows you to open a tunnel through a randomly generated URL they provide you. Locally on the machine you run an application that connects to their servers and forwards packets to and from a local port and their service.
What does ngrok do? it isn’t particularly clear from their website.
Does it relay all traffic between clients? or does it simply act as negotiator for nat hole punching?
Relaying obviously has major performance implications.
If UPnP isn’t a sufficiently encompassing solution, the OP should look at Hole punching.
Excellent explanation here:
The complete solution for nat traversal is:
1st) Test if UPnP is supported by the nat router. If not…
2nd) Attempt to hole punch a direct connection. If not…
3rd) Fall back to relaying traffic via a 3rd party server. (and inform the client that their performance will be degraded until they manually forward the ports required by your application.)