Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
socks5.js
Advanced tools
Readme
SOCKS v5 proxy server implementation in JavaScript for Node.js.
Install the library from npm:
$ npm install socks5.js --save
Then require it:
const socks5 = require("socks5.js")
// or
import socks5 from "socks5.js"
The function socks5
used to create a new SOCKS5 server, here is an example usage:
var socks5 = require('socks5.js')
var net = require('net')
var udp = require('dgram')
var server = socks5({
debug: true,
port: 1080,
host: '::',
handleConnect: (sock, accept, deny, info) => {
var socket = net.connect(info.dstPort, info.dstAddress)
socket.on('connect', () => {
accept()
sock.pipe(socket)
socket.pipe(sock)
})
socket.on('error', err => console.error(err))
},
handleUdpAssociate: (msg, accept, deny, info) => {
var socket = udp.createSocket('udp4')
socket.on('error', err => {
console.error('Error: ' + err)
socket.close()
})
socket.once('message', (msg, rinfo) => {
accept(msg)
socket.close()
})
socket.send(msg, info.dstPort, info.dstAddress)
}
}, err => {
if (!err) {
var { address, port } = server.address()
console.log(`SOCKS5 proxy server started on ${address}:${port}!`)
} else {
if (err.code === 'EADDRINUSE') {
log('Address in use, retrying...')
setTimeout(() => {
server.close()
server.start()
}, 10000)
}
}
})
Give this cool project a star ⭐! I will appreciate it ❤
FAQs
SOCKS v5 proxy server implementation in JavaScript for Node.js.
The npm package socks5.js receives a total of 1 weekly downloads. As such, socks5.js popularity was classified as not popular.
We found that socks5.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.