sujiacong / libsocks_client

SOCKS client rust implementation
MIT License
0 stars 0 forks source link

Allow SOCKS5/SOCKS4a to resolve DNS on the proxy #1

Closed Sytten closed 1 month ago

Sytten commented 2 months ago

Both protocols support sending the domain in the CONNECT packet.

sujiacong commented 1 month ago

This is currently supported in SOCKS5/SOCKS4a. You can use the following code to parse DNS from the server side. let mut client = SocksClientBuilder::new(proxyip, proxyport).socks4a().build_tcp_client(); let mut stream = client.connect_hostname("www.baidu.com", 80).await?; You can refer to a SOCKS testing tool I wrote. sockstest

sujiacong commented 1 month ago

It should be noted that the Dante SOCKS server does not support SOCKS4a