proxychains-ng icon indicating copy to clipboard operation
proxychains-ng copied to clipboard

Support for SOCKS5 UDP_ASSOCIATE command

Open hc-syn opened this issue 1 year ago • 6 comments

I have been working on the UDP support in ProxyChains. I have written a wiki (https://github.com/hc-syn/proxychains-ng/wiki) to explain my implementation.

hc-syn avatar Jun 20 '24 14:06 hc-syn

looks interesting , why its still not merged yet?

Abhinavpatel00 avatar Aug 15 '24 03:08 Abhinavpatel00

@Abhinavpatel00 proxychains wasn't designed with UDP in mind, and integrating this properly is a huge task - or even impossible, if we want to keep all existing configuration knobs working.

first of all, this PR only supports UDP via socks5, whereas proxychains supports HTTP, SOCKS4(a) and SOCKS5. next it's unclear whether this PR only supports a single proxy, or chaining of multiple proxies - which is the main feature of proxychains, as reflected in the name. it's also unclear whether the PR works properly with dnat, localnet, and all the other features. the PR is also huge - more than 2000 lines of code changed or added. a proper review would require a lot of time, which i'm currently unable to spend. even with that done, it's likely a lot of new bugs would be introduced in corner-cases, which i would have to fix myself over time.

last but not least the PR introduces a dependency on libuv, if i understand correctly, just because the author likes that particular library and wants to support it out-of-the-box. that's completely unacceptable for upstreaming. i think the author is aware of these points and chose from the get-go to do his own feature-fork, as evident from the PR description and the linked-to wiki.

rofl0r avatar Aug 15 '24 13:08 rofl0r

@Abhinavpatel00 proxychains wasn't designed with UDP in mind, and integrating this properly is a huge task - or even impossible, if we want to keep all existing configuration knobs working.

first of all, this PR only supports UDP via socks5, whereas proxychains supports HTTP, SOCKS4(a) and SOCKS5. next it's unclear whether this PR only supports a single proxy, or chaining of multiple proxies - which is the main feature of proxychains, as reflected in the name. it's also unclear whether the PR works properly with dnat, localnet, and all the other features. the PR is also huge - more than 2000 lines of code changed or added. a proper review would require a lot of time, which i'm currently unable to spend. even with that done, it's likely a lot of new bugs would be introduced in corner-cases, which i would have to fix myself over time.

last but not least the PR introduces a dependency on libuv, if i understand correctly, just because the author likes that particular library and wants to support it out-of-the-box. that's completely unacceptable for upstreaming. i think the author is aware of these points and chose from the get-go to do his own feature-fork, as evident from the PR description and the linked-to wiki.

thanks a ton for such a detailed reply :D , you might be on of the most humble oss maintainer out there

Abhinavpatel00 avatar Aug 15 '24 13:08 Abhinavpatel00

Hello, since the Discord is now blocked in Russia, this will be very useful. Voice calls don't work without UDP and I can't find any other software to proxify UDP... (except tun interface) Any update?

Zerogoki00 avatar Jan 09 '25 22:01 Zerogoki00

Any update?

you can try out the fork's version i guess?

rofl0r avatar Jan 09 '25 23:01 rofl0r

I tested this version, it doesn't compile with GCC 14, GCC 13 compiled fine, it works normally with IPv4 UDP connections, but not with IPv6 ones:

$ ./proxychains4 -f src/proxychains.conf host g.co 1.1.1.1
[proxychains] config file found: src/proxychains.conf
[proxychains] preloading ./libproxychains4.so
[proxychains] DLL init: proxychains-ng 
[proxychains] UDP_ASSOCIATE tcp socket chain  ...  127.0.0.1:1080  --> Node[127.0.0.1:55350] open
Using domain server:
Name: 1.1.1.1
Address: 1.1.1.1#53
Aliases: 

g.co has address 142.250.80.110
[proxychains] UDP_ASSOCIATE tcp socket chain  ...  127.0.0.1:1080  --> Node[127.0.0.1:38542] open
g.co has IPv6 address 2607:f8b0:4006:80d::200e
[proxychains] UDP_ASSOCIATE tcp socket chain  ...  127.0.0.1:1080  --> Node[127.0.0.1:33651] open
[proxychains] UDP_ASSOCIATE tcp socket chain  ...  127.0.0.1:1080  --> Node[127.0.0.1:35070] open
$ ./proxychains4 -f src/proxychains.conf host g.co 2606:4700:4700::1001
[proxychains] config file found: src/proxychains.conf
[proxychains] preloading ./libproxychains4.so
[proxychains] DLL init: proxychains-ng 
[proxychains] UDP_ASSOCIATE tcp socket chain  ...  127.0.0.1:1080  --> Node[127.0.0.1:35462] open
;; UDP setup with 2606:4700:4700::1001#53(2606:4700:4700::1001) for g.co failed: address family not supported.
;; no servers could be reached
[proxychains] UDP_ASSOCIATE tcp socket chain  ...  127.0.0.1:1080  --> Node[127.0.0.1:57170] open
;; UDP setup with 2606:4700:4700::1001#53(2606:4700:4700::1001) for g.co failed: address family not supported.
;; no servers could be reached

przemyslaw0 avatar Mar 23 '25 22:03 przemyslaw0