Refactor proxy support into a separate class that represents the proxy connection as a real object.