arti/crates/tor-socksproto
Nick Mathewson daf5ecc153 Bump crate versions in preparation for v1.1.5 release.
Generated with the following commands:

```
cargo set-version --bump minor -p tor-cell
cargo set-version --bump minor -p tor-linkspec
cargo set-version --bump minor -p tor-proto
cargo set-version --bump minor -p tor-netdoc
cargo set-version --bump minor -p tor-circmgr

cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-basic-utils
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-hscrypto
cargo set-version --bump patch -p tor-checkable
cargo set-version --bump patch -p tor-async-utils
cargo set-version --bump patch -p caret
cargo set-version --bump patch -p fs-mistrust
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p retry-error
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-events
cargo set-version --bump patch -p tor-units
cargo set-version --bump patch -p tor-rtcompat
cargo set-version --bump patch -p tor-rtmock
cargo set-version --bump patch -p tor-protover
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-socksproto
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-congestion
cargo set-version --bump patch -p tor-persist
cargo set-version --bump patch -p tor-chanmgr
cargo set-version --bump patch -p tor-ptmgr
cargo set-version --bump patch -p tor-guardmgr
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-hsclient
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p arti-rpcserver
cargo set-version --bump patch -p arti-config
cargo set-version --bump patch -p arti-hyper
cargo set-version --bump patch -p arti
cargo set-version --bump patch -p arti-bench
cargo set-version --bump patch -p arti-testing
```
2023-06-01 10:03:05 -04:00
..
fuzz Do not .gitignore crates/*/fuzz/corpus 2023-01-20 17:29:00 +00:00
src s/ProtocolFailed/ProtocolViolation/g where possible 2023-04-08 07:47:28 -07:00
Cargo.toml Bump crate versions in preparation for v1.1.5 release. 2023-06-01 10:03:05 -04:00
README.md Update README.md files (automated). 2022-05-06 09:51:11 -04:00

README.md

tor-socksproto

Implements SOCKS in the flavors provided by Tor.

Overview

SOCKS is an old and somewhat janky protocol for telling a TCP proxy where to connect. Versions 4, 4a, and 5 are sometimes encountered in the wild.

The tor-socksproto crate tries to hide the actual details of the protocol, and expose a stateful handshake type that eventually provides a [SocksRequest] or an error. It is part of Arti, a project to implement Tor in Rust. At present, it is only used to provide a SOCKS proxy over the Tor network, but eventually it may be used to implement support for connecting to the Tor network over a SOCKS proxy.

This crate may be a good choice for you if you need a SOCKS implementation that "behaves like Tor", but otherwise it is probably better to use some other SOCKS crate.

For more information about SOCKS:

  • SOCKS5 (which is preferred) is specified in RFC 1928, and see also RFC 1929 for Username/Password authentication in SOCKS5.
  • The wikipedia article is the best surviving documentation for SOCKS4 and SOCKS4a.
  • See socks-extensions.txt for a description of Tor's extensions and restrictions on the SOCKS protocol.

Design notes

Arti uses this crate instead of some other SOCKS implementation, for two reasons:

  • First, because we need to support Tor SOCKS extensions.
  • Second, and because we sometimes need to see particular details of the individual handshakes that most other SOCKS implementations don't expose. (For example, if we are told to connect to a raw IP address, the type of the handshake can help us guess whether that IP address came from a DNS responsein which case we should warn about a possible DNS leak.)

Currently, tor-socksproto does no networking code: it only implements the server (proxy) side of the SOCKS handshake by handling a series of bytes. We may (or may not) want to add network functionality to this crate or elsewhere in the future. We'll definitely want to add client functionality.

Possibly, this approach will prove useful for other uses. If it does, We can put the tor-only functionality behind a Cargo build feature, so that others can use this crate more safely.

License: MIT OR Apache-2.0