Add proxyUrl to impit.fetch()
#139
Replies: 2 comments 2 replies
-
|
This is intended behaviour, as reusing the same 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 |
Beta Was this translation helpful? Give feedback.
-
|
I turned this into a discussion (not closing this), since we're definitely open to interface improvement ideas. Would e.g. something like import { Impit, fetch } from 'impit'
// Persistent client reusing network resources
const client = new Impit();
await client.fetch();
await client.fetch();
// Ad-hoc client creation (each top-level `fetch` call creates a new one-use `Impit`)
await fetch()
await fetch()
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to be able to use a
proxyUrlwithinimpit.fetch()similarly to Bun's fetch() or gotScraping. Currently you can only setproxyUrlon aImpitinstance, which means you are limited to either use a single proxy or a rotating proxy endpoint. By being able to use theproxyUrlon thefetch()method directly you would instead be able to change the proxy used for each single request.Beta Was this translation helpful? Give feedback.
All reactions