Add the same parse_port logic to proxy.py too

This will fix the google domain resolving part of proxy.py.