Skip to content

Do we have any plan to add proxy IP for a single request ? #1194

Closed

Description

@Iflier

Hi developers,

This is a great work!

Checklist

  • There are no similar issues or pull requests for this yet.
  • I discussed this idea on the community chat and feedback is positive.

Is your feature related to a problem? Please describe.

For the network data collection related jobs, sometimes, a single proxy IP may be invalid after making several requests. In this case, use a single proxy IP for each request, rather than use a Client instance maybe more appropriate. I know, we can set a proxy IP when create a Client(or AsyncClient) instance, while if the proxy ip used in Client instance become unavailable after several requests, we may need to create another Client instance, I'm not sure if say it like this is correct :-( .

Describe the solution you would like.

Do we have any plan to enable httpx.request(...) has a proxies arg, just like requests do ?

Describe alternatives you considered

Additional context

Activity

  1. added
    questionFurther information is requested
    proxiesIssues related to HTTP and SOCKS proxies
    on Aug 18, 2020
  2. florimondmanca commented on Aug 18, 2020

    @florimondmanca
    Contributor

    Hi,

    Well true, Requests supports passing proxies on the high level API, so we might want to consider this as well. Not costly in terms of implementation, since it's mostly an extra argument to forward to the underlying client constructor.

    https://requests.readthedocs.io/en/master/user/advanced/#proxies

  3. added
    requests-compatIssues related to Requests backwards compatibility
    enhancementNew feature or request
    and removed
    questionFurther information is requested
    on Aug 18, 2020
  4. lovelydinosaur commented on Aug 18, 2020

    @lovelydinosaur
    Member

    Yup, we'd need to be clear that we're not supporting client.request(..., proxies=...), but I don't see any reason why we shouldn't support it in the top-level helper functions, httpx.request & pals.

  5. Iflier commented on Aug 18, 2020

    @Iflier
    Author

    Okey, I got it. Thanks for your clarification 👍 . @florimondmanca @tomchristie

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

    enhancementNew feature or requestproxiesIssues related to HTTP and SOCKS proxiesrequests-compatIssues related to Requests backwards compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions