Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I send UDP packets through a SOCKS5 proxy in NodeJS?

Tags:

node.js

proxy

udp

Is there a way to send UDP packets through a SOCKS5 proxy in NodeJS?

Similarly, is it possible to bind a UDP socket to a specific localAddress?

like image 702
Alexandre Kirszenberg Avatar asked May 09 '13 22:05

Alexandre Kirszenberg


People also ask

Does SOCKS5 support UDP?

Unlike its predecessors, which only used TCP protocol, SOCKS5 proxy servers can use UDP protocol, ensuring a reliable connection and efficient performance. The TCP internet protocol forms a connection between a client and a server, making sure that all the packets arrive from one side to the other.

Does SOCKS proxy support UDP?

You can configure UDP (User Datagram Protocol) when Web Gateway is running as a proxy under the SOCKS protocol. When traffic going on under the SOCKS protocol is processed by the proxy functions on Web Gateway, traffic that follows UDP can also be detected and forwarded.

Can you proxy UDP traffic?

You can't proxy UDP, simply because unlike TCP, UDP is a connectionless protocol. A proxy relies on you making a connection to the proxy server, that proxy server making the request on your behalf, and then returning the data back to you. What you need to do is rewrite the packets as they go through your firewall.

Is SOCKS TCP or UDP?

A SOCKS proxy server creates a Transmission Control Protocol (TCP) connection to another server behind the firewall on the client's behalf, then exchanges network packets between the client and the actual server.


1 Answers

The SOCKS5 protocol supports UDP connections, however most libraries for SOCKS5 only support TCP since UDP isn't very frequently used on the web (except for DNS). The protocol itself isn't very complicated, so it shouldn't be to hard to rewrite an existing library (maybe this one?) to suit your needs.

like image 51
Janos Pasztor Avatar answered Nov 15 '22 00:11

Janos Pasztor