Closed
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Description
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.
Metadata
Metadata
Assignees
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
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.)