lsalzman / enet

ENet reliable UDP networking library
MIT License
2.71k stars 669 forks source link

How do I use SOCKS protocol in enet? #177

Closed GitOlli closed 2 years ago

GitOlli commented 2 years ago

Hello!

I have been playing around with SOCKS protocol lately, and I was wondering how do you use SOCKS protocol in enet? Does it require custom logic for data receiving and sending?

Best regards: Olli.

Nable80 commented 2 years ago

Do you mean ENet over SOCKS tunneling?

ENet uses UDP proto for transport which isn't supported by most SOCKS proxies. If your proxy is UDP-capable, you can try socksify or tun2socks wrappers.

DrOreo002 commented 2 years ago

Hey, I've been wondering the same thing have you found the solution yet?

GitOlli commented 2 years ago

Hi, I ended up just modifying ENet to support SOCKS5 UDP. It was kinda hard so i recommend using wrappers as mentioned above, but if you want to do it the hard way you need to follow the "RFC 1928" standard.

DrOreo002 commented 2 years ago

Hi, I ended up just modifying ENet to support SOCKS5 UDP. It was kinda hard so i recommend using wrappers as mentioned above, but if you want to do it the hard way you need to follow the "RFC 1928" standard.

Ah alright, thank you

Calinou commented 2 years ago

Hi, I ended up just modifying ENet to support SOCKS5 UDP. It was kinda hard so i recommend using wrappers as mentioned above, but if you want to do it the hard way you need to follow the "RFC 1928" standard.

Could you upload your work to a Git repository? This would be helpful for others :slightly_smiling_face:

GitOlli commented 2 years ago

Hi, I ended up just modifying ENet to support SOCKS5 UDP. It was kinda hard so i recommend using wrappers as mentioned above, but if you want to do it the hard way you need to follow the "RFC 1928" standard.

Could you upload your work to a Git repository? This would be helpful for others 🙂

I would want to, but many games use ENet for networking so people would probably use it for malicious purposes.

Calinou commented 2 years ago

I would want to, but many games use ENet for networking so people would probably use it for malicious purposes.

I don't see how SOCKS support can be used for malicious purposes, especially if an existing ENet server does not support SOCKS on its own.

GitOlli commented 2 years ago

I would want to, but many games use ENet for networking so people would probably use it for malicious purposes.

I don't see how SOCKS support can be used for malicious purposes, especially if an existing ENet server does not support SOCKS on its own.

The ENet server doesn't need to support SOCKS5 protocol for it to work, because the SOCKS5 proxy just relays the data. You should read the standard found here -> https://www.rfc-editor.org/rfc/rfc1928

DrOreo002 commented 2 years ago

Hi, I ended up just modifying ENet to support SOCKS5 UDP. It was kinda hard so i recommend using wrappers as mentioned above, but if you want to do it the hard way you need to follow the "RFC 1928" standard.

Hi again, wondering why you choose to modify enet instead of using the wrapper?

GitOlli commented 2 years ago

Hi, I ended up just modifying ENet to support SOCKS5 UDP. It was kinda hard so i recommend using wrappers as mentioned above, but if you want to do it the hard way you need to follow the "RFC 1928" standard.

Hi again, wondering why you choose to modify enet instead of using the wrapper?

Because if you would choose to use a wrapper you would have to have an external application open that would do the tunneling.

playingoDEERUX commented 2 years ago

My insane ENet socks5 implementation is here: https://github.com/playingoDEERUX/ENetSocks5 It's been designed for one specific game though, but the implementation is inside the enet folder (include and source).

GitOlli commented 2 years ago

My ENet socks5 implementation is here: https://github.com/teocoder/enet-socks5

It's based on https://github.com/zpl-c/enet so it's single header. It supports async, ipv6, username and pass auth and numerous other things that i'm too lazy to list here because I quit this stuff. Just check for yourself and u will see.