Skip to main content

Module proxy

Module proxy 

Source
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Β§

ProxyContext πŸ”’
Information used to implement a proxy listener.
StreamIsolationKey πŸ”’
A Key used to isolate connections.
StreamProxy
A stream proxy listening on one or more local ports, ready to relay traffic.

EnumsΒ§

ListenProtocols
A set of proxy protocols to support on a listener.
ProvidedIsolation πŸ”’
Isolation information provided through the proxy connection
ProxyProtocols πŸ”’
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 error is a tor_proto::Error, return a reference to that tor_proto::Error.
handle_proxy_conn πŸ”’
Handle a single connection stream from 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Β§

ListenerIsolation πŸ”’
Type alias for the isolation information associated with a given proxy connection before any negotiation occurs.