Skip to content

Add proxyUrl to impit.fetch() #138

Closed

Description

@garysassano

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.

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Apr 16, 2025
  2. barjin commented on Apr 17, 2025

    @barjin
    Member

    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.)

  3. locked and limited conversation to collaborators on Apr 17, 2025
  4. converted this issue into a discussion #139 on Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions