Commit 7d4346a9 authored by Julien Muchembled's avatar Julien Muchembled

Remove \t from upnpigd.py

parent ae92b1eb
......@@ -3,17 +3,17 @@ import socket
# return (address, port)
def ForwardViaUPnP(localPort):
u = miniupnpc.UPnP()
u.discoverdelay = 200
u.discover()
u.selectigd()
externalPort = 1194
while True:
while u.getspecificportmapping(externalPort, 'UDP') != None:
externalPort = max(externalPort + 1, 49152)
if externalPort == 65536:
raise Exception
if u.addportmapping(externalPort, 'UDP', u.lanaddr, localPort, 'Vifib openvpn server', ''):
return (u.externalipaddress(), externalPort)
u = miniupnpc.UPnP()
u.discoverdelay = 200
u.discover()
u.selectigd()
externalPort = 1194
while True:
while u.getspecificportmapping(externalPort, 'UDP') != None:
externalPort = max(externalPort + 1, 49152)
if externalPort == 65536:
raise Exception
if u.addportmapping(externalPort, 'UDP', u.lanaddr, localPort, 'Vifib openvpn server', ''):
return (u.externalipaddress(), externalPort)
# TODO : specify a lease duration
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment