How a forwarder works
A forwarder is a tiny proxy that runs on your own computer. Your program connects to it without a login. The forwarder then connects to the real proxy and adds the username and password itself. To your program, the proxy is simply 127.0.0.1 and a port.
With gost
gost is a single program for Windows, macOS and Linux. One command starts a forwarder on port 8899:
Shell
gost -L=:8899 -F=http://USERNAME:PASSWORD@resi.piratproxies.com:8080Now give your tool the proxy 127.0.0.1 with port 8899, and no login. Check it:
Shell
curl -x http://127.0.0.1:8899 https://api.ipify.orgWith mitmproxy
If you already use mitmproxy, its upstream mode does the same job:
Shell
mitmdump --mode upstream:http://resi.piratproxies.com:8080 --upstream-auth USERNAME:PASSWORD -p 8899In Node.js
The proxy-chain package starts a forwarder from code and gives you its address, which is convenient for Puppeteer and Selenium scripts:
Node.js
const proxyChain = require('proxy-chain');
(async () => {
const local = await proxyChain.anonymizeProxy('http://USERNAME:PASSWORD@resi.piratproxies.com:8080');
console.log(local); // http://127.0.0.1:<port>, no login needed
})();One forwarder per address
A forwarder carries one username. To use several IP addresses at once, start several forwarders on different ports, each with a different session ID in its username.
Keep forwarders on 127.0.0.1. A forwarder that listens on your network lets anyone on that network use your plan.
Questions
Does a forwarder slow things down?
Not noticeably. It runs on your own machine and only passes traffic along.
Which tools need this?
Anything built on Chrome's own proxy flag, such as plain Selenium, WebdriverIO and undetected-chromedriver, and tools such as Octoparse that take only an IP address and a port.