How to use the socks.createUDPFrame function in socks

To help you get started, we’ve selected a few socks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jigsaw-Code / outline-client / src / electron / connectivity.ts View on Github external
(err, socket, info) => {
          if (err) {
            reject(new errors.RemoteUdpForwardingDisabled(`could not connect to local proxy`));
          const packet = socks.createUDPFrame({host: '', port: 53}, DNS_REQUEST);
          const udpSocket = dgram.createSocket('udp4');

          udpSocket.on('error', (e) => {
            reject(new errors.RemoteUdpForwardingDisabled('UDP socket failure'));

          udpSocket.on('message', (msg, info) => {

          // Retry sending the query every second.
          // TODO: logging here is a bit verbose
          const intervalId = setInterval(() => {
            try {
              udpSocket.send(packet, info.port,, (err) => {


Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.

Latest version published 9 days ago

Package Health Score

83 / 100
Full package analysis