Allow setting User-Agent (and other headers), respect port number in urls