Expand description
Fast SOCKS5 client/server implementation written in Rust async/.await (with tokio).
This library is maintained by anyip.io a residential and mobile socks5 proxy provider.
§Features
- An
async/.awaitSOCKS5 implementation. - An
async/.awaitSOCKS4 Client implementation. - An
async/.awaitSOCKS4a Client implementation. - No unsafe code
- Built on top of the Tokio runtime
- Ultra lightweight and scalable
- No system dependencies
- Cross-platform
- Infinitely extensible, explicit server API based on typestates for safety
- You control the request handling, the library only ensures you follow the proper protocol flow
- Can skip DNS resolution
- Can skip the authentication/handshake process (not RFC-compliant, for private use, to save on useless round-trips)
- Instead of proxying in-process, swap out
run_tcp_proxyfor custom handling to build a router or to use a custom accelerated proxying method
- Authentication methods:
- No-Auth method (
0x00) - Username/Password auth method (
0x02) - Custom auth methods can be implemented on the server side via the
AuthMethodTrait- Multiple auth methods with runtime negotiation can be supported, with fast static dispatch (enums can be generated with the
auth_method_enumsmacro)
- Multiple auth methods with runtime negotiation can be supported, with fast static dispatch (enums can be generated with the
- No-Auth method (
- UDP is supported
- All SOCKS5 RFC errors (replies) should be mapped
IPv4,IPv6, andDomainstypes are supported
§Install
Open in crates.io.
§Examples
Please check examples directory.
Modules§
Macros§
- auth_
method_ enums - read_
exact - Easy to destructure bytes buffers by naming each fields:
- ready
Enums§
- Authentication
Method - Reply
Error - SOCKS5 reply code
- Socks5
Command - Socks
Error - UdpHeader
Error
Functions§
- new_
udp_ header - Generate UDP header
- parse_
udp_ request - Parse data from UDP client on raw buffer, return (frag, target_addr, payload).