I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit b45dfb85 authored by zzz's avatar zzz
Browse files

- Change UPnP listener port defaults, allow configuration option

parent 3db244f5
No related branches found
No related tags found
No related merge requests found
...@@ -23,8 +23,6 @@ import org.freenetproject.ForwardPortStatus; ...@@ -23,8 +23,6 @@ import org.freenetproject.ForwardPortStatus;
* Bridge from the I2P RouterAddress data structure to * Bridge from the I2P RouterAddress data structure to
* the freenet data structures * the freenet data structures
* *
* UPnP listens on ports 1900, 8008, and 8058 - no config option yet.
*
* @author zzz * @author zzz
*/ */
public class UPnPManager { public class UPnPManager {
...@@ -35,12 +33,24 @@ public class UPnPManager { ...@@ -35,12 +33,24 @@ public class UPnPManager {
private boolean _isRunning; private boolean _isRunning;
private InetAddress _detectedAddress; private InetAddress _detectedAddress;
private TransportManager _manager; private TransportManager _manager;
/**
* This is the TCP HTTP Event listener
* We move these so we don't conflict with other users of the same upnp library
* UPnP also binds to port 1900 UDP for multicast reception - this cannot be changed.
*/
private static final String PROP_HTTP_PORT = "i2np.upnp.HTTPPort";
private static final int DEFAULT_HTTP_PORT = 7652;
/** this is the UDP SSDP Search reply listener */
private static final String PROP_SSDP_PORT = "i2np.upnp.SSDPPort";
private static final int DEFAULT_SSDP_PORT = 7653;
public UPnPManager(RouterContext context, TransportManager manager) { public UPnPManager(RouterContext context, TransportManager manager) {
_context = context; _context = context;
_manager = manager; _manager = manager;
_log = _context.logManager().getLog(UPnPManager.class); _log = _context.logManager().getLog(UPnPManager.class);
_upnp = new UPnP(context); _upnp = new UPnP(context);
_upnp.setHTTPPort(_context.getProperty(PROP_HTTP_PORT, DEFAULT_HTTP_PORT));
_upnp.setSSDPPort(_context.getProperty(PROP_SSDP_PORT, DEFAULT_SSDP_PORT));
_upnpCallback = new UPnPCallback(); _upnpCallback = new UPnPCallback();
_isRunning = false; _isRunning = false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment