Skip to main content

Module http_connect

Module http_connect 

Source
Expand description

Implement an HTTP1 CONNECT proxy using hyper.

Note that Tor defines several extensions to HTTP CONNECT; See the spec for more information.

ModulesΒ§

hdr πŸ”’
Constants and code for the HTTP headers we use.
hyper_futures_io πŸ”’
Helper module: Make futures types usable by hyper.

StructsΒ§

Isolation πŸ”’
A value used to isolate streams received via HTTP CONNECT.

EnumsΒ§

HttpConnectError πŸ”’
An error that occurs during an HTTP CONNECT attempt, which can (usually) be reported to the client.
ProxyAuthorization πŸ”’
An isolation value based on the Proxy-Authorization header.

TraitsΒ§

RespBldExt πŸ”’
Extension trait on ResponseBuilder

FunctionsΒ§

add_common_headers πŸ”’
Add all common headers to the builder bld, and return a new builder.
capabilities πŸ”’
Return a string representing our capabilities.
deconstruct_upgrade πŸ”’
Recover the original stream from a hyper::upgrade::Upgraded.
end_reason_to_http_status πŸ”’
Return the appropriate HTTP status code for a remote END reason.
find_conn_target πŸ”’
Look up the connection target given the value of an Tor-RPC-Target header.
handle_connect_request πŸ”’
Return an appropriate reply to the given CONNECT request.
handle_connect_request_impl πŸ”’
Helper for handle_connect_request: return an error type that can be converted into an HTTP message.
handle_http_conn πŸ”’
Given a just-received TCP connection S on a HTTP proxy port, handle the HTTP handshake and relay the connection over the Tor network.
handle_http_request πŸ”’
Handle a single HTTP request.
handle_options_request πŸ”’
Return an appropriate reply to the given OPTIONS request.
host_is_localhost πŸ”’
Return true if host is a possible value for a Host header addressing localhost.
set_family_preference πŸ”’
Set the IP family preference in prefs.
set_isolation πŸ”’
Configure the stream isolation from the provided headers.
transfer πŸ”’
Recover the application stream from request, and launch tasks to transfer data between the application and the tor_stream.

Type AliasesΒ§

Body πŸ”’
We use β€œString” as our body type, since we only return a body on error, in which case it already starts life as a formatted string.
ClientError πŸ”’
Error type returned from a failed connect_with_prefs.
Request πŸ”’
Request type that we receive from Hyper.