Skip to content

httpx not playing along well with proxy with authentication #847

Closed

Description

@AntonioL

I am trying to use a NordVPN HTTP Proxy. One needs to supply user and password.

From reading the documentation of httpx it seems to me that the below should work but I am getting error code 407 which means that authentication definitely did not happen.

I can provide more information to troubleshoot if needed. I am not sure what is going on in there and what info would you need for that.

    proxy = httpx.Proxy(
        url=f"http://[username]%40[mail-domain]:[password]@{proxy}:80"
    )

    with httpx.Client(proxies=proxy, trust_env=False) as client:
        resp = client.get("https://www.gazzetta.it")
        print(resp.text)

Activity

  1. AntonioL commented on Mar 4, 2020

    @AntonioL
    Author

    Actually it seems similar to this issue:
    #780

    WIll try updating the httpx library.

  2. florimondmanca commented on Mar 4, 2020

    @florimondmanca
    Contributor

    Closing as a duplicate of #779 for now, feel free to reopen if you come across any issues with the latest version of HTTPX. :)

  3. AntonioL commented on Mar 4, 2020

    @AntonioL
    Author

    I am using 0.11.1 version of the library.

    I suspect that the fix in there did not make into a new package version, right?

  4. florimondmanca commented on Mar 4, 2020

    @florimondmanca
    Contributor

    Ah indeed, latest release is from Jan 17 (quite a while back now!), and #780 was merged on Jan 19.

    Can you verify this is fixed on master? A new release should be coming soon (see #829), although it's a shame we didn't get to publish a point release for #780 back then.

  5. AntonioL commented on Mar 4, 2020

    @AntonioL
    Author

    Cool! Time to sharpen up my pip voodoo.

    Thanks for the advice

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

    duplicateThis issue or pull request already existsproxiesIssues related to HTTP and SOCKS proxies

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions