Skip to main content

Module proxied

Module proxied 

Source
Expand description

Connect to relays via a proxy.

This code is here for two reasons:

  1. To connect via external pluggable transports (for which we use SOCKS to build our connections).
  2. To support users who are behind a firewall that requires them to use a SOCKS proxy to connect.

Supports SOCKS4/4a/5 and HTTP CONNECT proxies.

Structsยง

ExternalProxyPlugin
An object that connects to a Tor bridge via an external pluggable transport that provides a proxy.

Enumsยง

Protocol
Information about what proxy protocol to use, and how to use it.
ProxyError
An error that occurs while negotiating a connection with a proxy.

Constantsยง

MAX_HTTP_HEADER_BYTES ๐Ÿ”’
Maximum number of bytes allowed in HTTP response headers from proxy.
NO_ADDR ๐Ÿ”’
An address to use when told to connect to โ€œno address.โ€

Functionsยง

build_http_connect_request ๐Ÿ”’
Build HTTP CONNECT request string with optional Basic auth.
connect_via_proxy ๐Ÿ”’
Open a connection to target via the proxy at proxy, using the protocol at protocol.
do_http_connect_handshake ๐Ÿ”’
Perform HTTP CONNECT proxy handshake (RFC 7231, RFC 7617 for Basic auth).
do_socks_handshake ๐Ÿ”’
Perform SOCKS proxy handshake.
encode_settings ๐Ÿ”’
Encode the PT settings from IT in a format that a pluggable transport can use.
format_connect_target ๐Ÿ”’
Format target address for HTTP CONNECT request line and Host header.
parse_http_connect_response ๐Ÿ”’
Parse HTTP CONNECT response and extract status code.
send_http_connect_request ๐Ÿ”’
Send HTTP CONNECT request to proxy.
settings_to_protocol
Transform a string into a representation that can be sent as SOCKS authentication.