Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
proxy-chain
Advanced tools
Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
For example, this library is useful if you need to use proxies with authentication in the headless Chrome web browser, but don't feel like setting up Squid or some other proxy server. The authentication and proxy chaining configuration is provided in code and can be dynamic.
const ProxyChain = require('proxy-chain');
const server = new ProxyChain.Server({ port: 8000 });
server.listen(() => {
console.log(`Proxy server is listening on port ${8000}`);
});
const ProxyChain = require('proxy-chain');
const server = new ProxyChain.Server({
// Port where the server the server will listen. By default 8000.
port: 8000,
// Enables verbose logging
verbose: true,
// Custom function to authenticate proxy requests and provide the URL to chained upstream proxy.
// It must return an object (or promise resolving to the object) with following form:
// { requestAuthentication: Boolean, upstreamProxyUrl: String }
// If the function is not defined or is null, the server runs in a simple mode.
prepareRequestFunction: ({ request, username, password, hostname, port, isHttp }) => {
return {
// Require clients to authenticate with username 'bob' and password 'TopSecret'
requestAuthentication: username !== 'bob' || password !== 'TopSecret',
// Sets up an upstream HTTP proxy to which all the requests are forwarded.
// If null, the proxy works in direct mode.
upstreamProxyUrl: `http://username:password@proxy.example.com:3128`,
};
},
});
server.listen(() => {
console.log(`Proxy server is listening on port ${8000}`);
});
FAQs
Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.
The npm package proxy-chain receives a total of 77,995 weekly downloads. As such, proxy-chain popularity was classified as popular.
We found that proxy-chain 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.