ProxyAddress

Added in version 2.26.

class ProxyAddress(**properties: Any)

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 for inetaddr with protocol that should tunnel through dest_hostname and dest_port.

(Note that this method doesn’t set the ProxyAddress:uri or ProxyAddress:destination-protocol fields; use new() 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.

get_destination_protocol() str

Gets the protocol that is being spoken to the destination server; eg, “http” or “ftp”.

Added in version 2.34.

get_password() str | None

Gets proxy’s password.

Added in version 2.26.

get_protocol() str

Gets proxy’s protocol. eg, “socks” or “http”

Added in version 2.26.

get_uri() str | None

Gets the proxy URI that proxy was constructed from.

Added in version 2.34.

get_username() str | None

Gets proxy’s username.

Added in version 2.26.

Properties

class ProxyAddress
props.destination_hostname: str

The proxy destination hostname.

Added in version 2.26.

props.destination_port: int

The proxy destination port.

Added in version 2.26.

props.destination_protocol: str

The protocol being spoke to the destination host, or None if the ProxyAddress doesn’t know.

Added in version 2.34.

props.password: str

The proxy password.

Added in version 2.26.

props.protocol: str

The proxy protocol.

Added in version 2.26.

props.uri: str

The URI string that the proxy was constructed from (or None if the creator didn’t specify this).

Added in version 2.34.

props.username: str

The proxy username.

Added in version 2.26.

Fields

class ProxyAddress
parent_instance
priv