Extending the SOCKS5 server
masterThe library provides an explicit server API based on typestates for safety, allowing for high extensibility:
- Custom Authentication: Implement the
AuthMethodtrait to support custom authentication methods. You can support multiple methods with runtime negotiation using theauth_method_enumsmacro for fast static dispatch. - Custom Request Handling: You can control the request handling flow. For example, you can skip DNS resolution or skip the authentication/handshake process for private use to reduce round-trips.
- Custom Proxying/Routing: Instead of using
run_tcp_proxyfor in-process proxying, you can swap it out for custom logic to build a router or use accelerated proxying methods.
Supported built-in authentication methods include No-Auth (0x00) and Username/Password (0x02).