port-forward
port-forward copied to clipboard
Wrong port parsing
./port-forward.py -v -e 31313 -r 10.0.0.1
Discovering routers...
Found 2 UPnP routers: 10.0.0.1:5431 192.168.1.2:1900
Traceback (most recent call last):
File "./port-forward.py", line 240, in <module>
status,message = open_port(service_url,args.eport,internal_client=localip,internal_port=args.iport,protocol=args.protocol,duration=args.time,description=args.description,enabled = enabled)
File "./port-forward.py", line 155, in open_port
conn = httplib.HTTPConnection(parsedurl.hostname, parsedurl.port)
File "/usr/lib/python2.7/urlparse.py", line 113, in port
port = int(port, 10)
ValueError: invalid literal for int() with base 10: '5431None'
I have no idea what might be causing it. Doesn't work on both Python 2 and 3, Debian.
I got this working by changing line 240 from "status,message = open_port(service_url, args.eport... " to "status,message = open_port(path, args.eport... ". I think get_wanip_path(path) in line 224 is causing a problem. Bypassing it seems to fix it for now.
I cannot replicate this issue any more.