-
Notifications
You must be signed in to change notification settings - Fork 0
Using UPnP
Universal Plug and Play (aka UPnP) is a series of network protocols that allow client-side programs to automatically port-forward. ServerInterconnet uses the weupnp library to assist with its port forwarding capabilities. By default, port forwarding is not enabled and must be called explicitly by the implementer.
To begin the port forwarding process, first create an instance of UPNPManager:
int port = 1337;
UPNPManager upnpManager = new UPNPManager(port);Then call the discover() and map() methods:
upnpManager.discover();
upnpManager.map(); //Returns a boolean showing whether it failed/succeededThe port is now forwarded! It is best practice to remove the port mapping when you no longer need it:
upnpManager.remove();Basic IO
Basic Client
Basic Server
Authenticated IO
Authenticated Client
Authenticated Server
Mesh
Mesh Network
Authenticated Mesh
Packets
Creating Packets
Sending Packets
Listening for Packets
Automatic Handlers
Response Handlers
UPnP
Port Forwarding