Module socks

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

AuthInterpretation πŸ”’
The meaning of a SOCKS authentication field, according to our conventions.
SocksConnContext πŸ”’
Information used to implement a SOCKS connection.
SocksIsolationKey πŸ”’
A Key used to isolate connections.

Enums§

ProvidedIsolation πŸ”’
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 into writer 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§

ConnIsolation πŸ”’
Type alias for the isolation information associated with a given SOCKS connection before SOCKS is negotiated.