semigodking / redsocks

transparent redirector of any TCP/UDP connection to proxy
Apache License 2.0
1.17k stars 247 forks source link

Can you support socks5h in the `type` field of redsocks.conf? #206

Open yukeiyang opened 4 days ago

yukeiyang commented 4 days ago

@semigodking , thanks for your wonderful development works on redsocks after darkk stopped supporting redsocks in the past several years. It's cool and thanks a lot.

/etc/redsocks.conf

base {
  log_debug = on;
  log_info = on;
  log = "stderr";
  daemon = off;
  redirector = iptables;
}

redsocks {
  bind = "127.0.0.1:12345";
  relay = "gate.visitxiangtan.com:7000";
  type = socks5;
  timeout = 300;
}

I checked and tried many times for these 2 situations

curl -4 -x socks5://gate.visitxiangtan.com:7000 -v https://example.com/ If set as socks5, the access is not stable. seems 50% failed.

curl -4 -x socks5h://gate.visitxiangtan.com:7000 -v https://example.com/ If set as socks5h, the access is very stable. 100% succeeded.

So, Can you add socks5h support in type field?

yukeiyang commented 4 days ago

Another, Seems all main proxy services are now supporting socks5h, and lots of them support socks5h only and not socks5, though we can use socks5 with some different ways, but officially, they do recommend socks5h only. For example, Smartproxy, Packetstream, etc.

yukeiyang commented 4 days ago

Causes lots of proxy services provider support socks5h ONLY officially, socks5 maybe meet some auth issues in proxy provider end here and there. That's why socks5 access is so weak and not stable, I guess.

semigodking commented 1 day ago

Socks5h is used by applications which knows domain name being requested. Redsocks works in IP layer and has no idea about the domain name. So, nothing can be done here

On Mon, Oct 21, 2024, 17:41 yukeiyang @.***> wrote:

@semigodking https://github.com/semigodking , thanks for your wonderful development works on redsocks after darkk https://github.com/darkk stopped supporting redsocks in the past several years. It's cool and thanks a lot.

/etc/redsocks.conf

base { log_debug = on; log_info = on; log = "stderr"; daemon = off; redirector = iptables; }

redsocks { bind = "127.0.0.1:12345"; relay = "gate.visitxiangtan.com:7000"; type = socks5; timeout = 300; }

I checked and tried many times for these 2 situations

curl -4 -x socks5://gate.visitxiangtan.com:7000 -v https://example.com/ If set as socks5, the access is not stable. seems 50% failed.

curl -4 -x socks5h://gate.visitxiangtan.com:7000 -v https://example.com/ If set as socks5h, the access is very stable. 100% succeeded.

So, Can you add socks5h support in type field?

— Reply to this email directly, view it on GitHub https://github.com/semigodking/redsocks/issues/206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP2XDYZSOJW6OO22ZRNLCTZ4TD35AVCNFSM6AAAAABQJVZINWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYDCOBXHA3TMNA . You are receiving this because you were mentioned.Message ID: @.***>