ProxyAddress#
Added in version 2.26.
Superclasses: InetSocketAddress
, SocketAddress
, Object
Implemented Interfaces: SocketConnectable
A InetSocketAddress
representing a connection via a proxy server.
Constructors#
- class ProxyAddress
- classmethod new(inetaddr: InetAddress, port: int, protocol: str, dest_hostname: str, dest_port: int, username: str | None = None, password: str | None = None) SocketAddress #
Creates a new
ProxyAddress
forinetaddr
withprotocol
that should tunnel throughdest_hostname
anddest_port
.(Note that this method doesn’t set the
ProxyAddress
:uri orProxyAddress
:destination-protocol fields; usenew()
directly if you want to set those.)Added in version 2.26.
- Parameters:
inetaddr – The proxy server
InetAddress
.port – The proxy server port.
protocol – The proxy protocol to support, in lower case (e.g. socks, http).
dest_hostname – The destination hostname the proxy should tunnel to.
dest_port – The destination port to tunnel to.
username – The username to authenticate to the proxy server (or
None
).password – The password to authenticate to the proxy server (or
None
).
Methods#
- class ProxyAddress
- get_destination_hostname() str #
Gets
proxy
's destination hostname; that is, the name of the host that will be connected to via the proxy, not the name of the proxy itself.Added in version 2.26.
- get_destination_port() int #
Gets
proxy
's destination port; that is, the port on the destination host that will be connected to via the proxy, not the port number of the proxy itself.Added in version 2.26.
Properties#
- class ProxyAddress