apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.

Home Page:https://www.npmjs.com/package/proxy-chain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to update upstreamProxyUrl dynamically ?

opened this issue · comments

I would like to use proxy-chain with multiple upstreamProxyUrl. Does someone would advise on the best way to dynamically update upstreamProxyUrl ?

Thanks
Simon

In prepareRequestFunction you have to pick one upstream proxy URL. If you have more, just pick one randomly. Or how else would you like this to behave and for what use case?

I would like to change the upstream proxy URL on demand. Is that something you would thing possible ?

It's not possible to switch connection on-the-fly, that would break it. You can cancel the connection yourself, the client will try to reconnect and at that moment you can give them another upstream proxy URL.

Since this is not an issue to be fixed, I'm closing this for now.