
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
socks5-proxy-server
Advanced tools
This module provides a SOCKS5 proxy server with optional authentication and support for forwarding requests through an upstream SOCKS5 proxy.
socksv5
socks
net
ipv6
ipv4
npm install socks5-proxy-server
(async () => {
const proxyServer = await app({ port: 1080, user: "test", password: "pass" });
console.log(
`Socks5 server running on localhost:${proxyServer.port}, ${
proxyServer.user && proxyServer.password ? `user:${proxyServer.user}, password:${proxyServer.password}` : "no authentication"
}`
);
})();
(async () => {
const proxyServer = await app({ port: 1080 });
console.log(
`Socks5 server running on localhost:${proxyServer.port}, ${
proxyServer.user && proxyServer.password ? `user:${proxyServer.user}, password:${proxyServer.password}` : "no authentication"
}`
);
})();
(async () => {
const proxyServer = await app({ user: "test", password: "pass" });
console.log(
`Socks5 server running on localhost:${proxyServer.port}, ${
proxyServer.user && proxyServer.password ? `user:${proxyServer.user}, password:${proxyServer.password}` : "no authentication"
}`
);
})();
(async () => {
const proxyServer = await app(
{ port: 1080, user: "test", password: "pass" },
{ hostProxy: "172.31.24.202", portProxy: 2001, userProxy: "gemink", passwordProxy: "proxys" }
);
console.log(
`Socks5 server running on localhost:${proxyServer.port}, ${
proxyServer.user && proxyServer.password ? `user:${proxyServer.user}, password:${proxyServer.password}` : "no authentication"
}`
);
})();
To stop the proxy server, you can simply terminate the process running the script:
CTRL + C
If running as a background process, use:
kill $(lsof -t -i:1080)
Replace 1080
with the actual port if different.
Alternatively, you can stop the server within the script:
proxyServer.server.close(() => {
console.log("Proxy server closed.");
});
process.on('uncaughtException', (err) => {
console.error("Unhandled exception:", err);
});
process.on('unhandledRejection', (reason, promise) => {
console.error("Unhandled rejection:", reason);
});
findFreePort()
Finds an available port.
validateConfig(config)
Validates the user configuration.
validateProxy(proxy)
Validates the proxy settings.
app(config, proxy)
Starts the SOCKS5 proxy server.
{ server: Object, port: number, user: null, password: null }
if successful.{ server: Object, port: number, user: string, password: string }
if successful.{ server: null, port: null, user: null, password: null }
if an error occurs.FAQs
create local socks5
The npm package socks5-proxy-server receives a total of 5 weekly downloads. As such, socks5-proxy-server popularity was classified as not popular.
We found that socks5-proxy-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.