proxy.client Module

Proxy support for HTTP requests.

class wpull.proxy.client.HTTPProxyConnectionPool(proxy_address, *args, proxy_ssl=False, authentication=None, ssl_context=True, host_filter=None, **kwargs)[source]

Bases: wpull.network.pool.ConnectionPool

Establish pooled connections to a HTTP proxy.

Parameters:
  • proxy_address (tuple) – Tuple containing host and port of the proxy server.
  • connection_pool (connection.ConnectionPool) – Connection pool
  • proxy_ssl (bool) – Whether to connect to the proxy using HTTPS.
  • authentication (tuple) – Tuple containing username and password.
  • ssl_context – SSL context for SSL connections on TCP tunnels.
  • host_filter (proxy.hostfilter.HostFilter) – Host filter which for deciding whether a connection is routed through the proxy. A test result that returns True is routed through the proxy.
acquire(host, port, use_ssl=False, host_key=None)[source]
acquire_proxy(host, port, use_ssl=False, host_key=None, tunnel=True)[source]

Check out a connection.

This function is the same as acquire but with extra arguments concerning proxies.

Coroutine.

add_auth_header(request)[source]

Add the username and password to the HTTP request.

no_wait_release(proxy_connection)[source]
release(proxy_connection)[source]