Expand description
Implement a simple SOCKS proxy that relays connections over Tor.
A proxy is launched with run_socks_proxy()
, which listens for new
connections and then runs
Modules§
- socks_
and_ πrpc rpc
- NOTE: The following documentation belongs in a spec. But for now, itβs our best attempt to document the design and protocol implemented here for integrating SOCKS with our RPC system. βnickm
Structs§
- Auth
Interpretation π - The meaning of a SOCKS authentication field, according to our conventions.
- Socks
Conn πContext - Information used to implement a SOCKS connection.
- Socks
Isolation πKey - A Key used to isolate connections.
Enums§
- Provided
Isolation π - Isolation information provided through the socks connection
Constants§
- WRONG_
PROTOCOL_ πPAYLOAD - Payload to return when an HTTP connection arrive on a Socks port
Functions§
- accept_
err_ πis_ fatal - Return true if a given IoError, when received from accept, is a fatal error.
- copy_
interactive π - Copy all the data from
reader
intowriter
until we encounter an EOF or an error. - handle_
socks_ πconn - Given a just-received TCP connection
S
on a SOCKS port, handle the SOCKS handshake and relay the connection over the Tor network. - interpret_
socks_ πauth - Given the authentication object from a socks connection, determine what itβs telling us to do.
- reply_
error π - Reply a Socks error based on an arti-client Error and close the stream. Returns the error provided in parameter
- run_
socks_ proxy - Launch a SOCKS proxy to listen on a given localhost port, and run indefinitely.
- stream_
preference - Find out which kind of address family we can/should use for a
given
SocksRequest
. - write_
all_ πand_ close - write_all the data to the writer & close the writer if write_all is successful.
- write_
all_ πand_ flush - write_all the data to the writer & flush the writer if write_all is successful.
Type Aliases§
- Conn
Isolation π - Type alias for the isolation information associated with a given SOCKS connection before SOCKS is negotiated.