Add the same parse_port logic to proxy.py too