Expand description
Implement a simple proxy that relays connections over Tor.
A proxy is launched with bind_proxy(), which opens listener ports.
StreamProxy::run_proxy then listens for new
connections, handles an appropriate handshake,
and then relays traffic as appropriate.
ModulesΒ§
- http_
connect - Implement an HTTP1 CONNECT proxy using
hyper. - port_
info - Record information about where we are listening to a file, so that other programs can find it without going through RPC.
- socks
- SOCKS-specific proxy support.
- socks_
and_ π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 proxies with our RPC system. βnickm
StructsΒ§
- Proxy
Context π - Information used to implement a proxy listener.
- Stream
Isolation πKey - A Key used to isolate connections.
- Stream
Proxy - A stream proxy listening on one or more local ports, ready to relay traffic.
EnumsΒ§
- Listen
Protocols - A set of proxy protocols to support on a listener.
- Provided
Isolation π - Isolation information provided through the proxy connection
- Proxy
Protocols π - A (possibly) supported proxy protocol.
ConstantsΒ§
- APP_
STREAM_ πBUF_ LEN - Size of read buffer to apply to application data streams and Tor data streams when copying.
FunctionsΒ§
- accept_
err_ πis_ fatal - Return true if a given IoError, when received from accept, is a fatal error.
- bind_
proxy - Launch a proxy to listen on a given set of ports.
- classify_
protocol_ πfrom_ first_ byte - Look at the first byte of a proxy connection, and guess what protocol what protocol it is trying to speak.
- extract_
proto_ πerr - If any source of the provided
erroris ator_proto::Error, return a reference to thattor_proto::Error. - handle_
proxy_ πconn - Handle a single connection
streamfrom an application. - report_
proxy_ πerror - Report an error that occurred within a single proxy task.
- run_
proxy_ with_ listeners - Launch a proxy from a given set of already bound listeners.
- 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Β§
- Listener
Isolation π - Type alias for the isolation information associated with a given proxy connection before any negotiation occurs.