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
futurestypes usable byhyper.
StructsΒ§
- Isolation π
- A value used to isolate streams received via HTTP CONNECT.
EnumsΒ§
- Http
Connect πError - An error that occurs during an HTTP CONNECT attempt, which can (usually) be reported to the client.
- Proxy
Authorization π - An isolation value based on the Proxy-Authorization header.
TraitsΒ§
- Resp
BldExt π - 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
Son 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
hostis 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 thetor_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.
- Client
Error π - Error type returned from a failed connect_with_prefs.
- Request π
- Request type that we receive from Hyper.