You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to use a proxyUrl within impit.fetch() similarly to Bun's fetch() or gotScraping. Currently you can only set proxyUrl on a Impit instance, which means you are limited to either use a single proxy or a rotating proxy endpoint. By being able to use the proxyUrl on the fetch() method directly you would instead be able to change the proxy used for each single request.
This is intended behaviour, as reusing the same Impit instance allows for HTTP connection pooling (reusing the underlying TLS / TCP resources for multiple subsequent requests).
HTTP connection pooling (and other resource-sharing notions, e.g. HTTP/2 internals) are not possible when using different proxies for different requests (two requests going to the same endpoint cannot use the same TCP connection if they are told to go through different proxies).
We'd prefer to communicate this idea in our interface too - the fact that you have to create a new Impit instance when switching proxies shows what's actually happening under the hood (Impit has to open a new socket, go through the TLS handshake etc.)
Activity
barjin commentedon Apr 17, 2025
This is intended behaviour, as reusing the same
Impitinstance allows for HTTP connection pooling (reusing the underlying TLS / TCP resources for multiple subsequent requests).HTTP connection pooling (and other resource-sharing notions, e.g. HTTP/2 internals) are not possible when using different proxies for different requests (two requests going to the same endpoint cannot use the same TCP connection if they are told to go through different proxies).
We'd prefer to communicate this idea in our interface too - the fact that you have to create a new
Impitinstance when switching proxies shows what's actually happening under the hood (Impit has to open a new socket, go through the TLS handshake etc.)