TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
871 stars 229 forks source link

Setting "family:4" is required on some hardware #316

Open Atheryl opened 1 month ago

Atheryl commented 1 month ago

Some hardware will pick IPV6 instead of IPV4 when setting a localAddress.

const opts = { host: host.replace(/^\[|\]$/g, ''), port, localAddress }; debug.proxyRequest('connecting to proxy target %o', opts); const target = net.connect(opts);

Should be

const opts = { host: host.replace(/^\[|\]$/g, ''), port, localAddress, family: {family (4 or 6)} }; debug.proxyRequest('connecting to proxy target %o', opts); const target = net.connect(opts);

I'll see to do a PR later.