Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: proxy http2 prior to knowledge support #1647

Closed

Conversation

p1-ra
Copy link

@p1-ra p1-ra commented May 21, 2021

Hi,

This PR is related to #1624 and required the following PR at httpcore side: encode/httpcore#342
It fix the HTTP2 prior of knowledge support for HTTP proxies.

  • 5a34fdd propagate client http1 support to the configured proxies
  • 9825d69 introduce new configurations on the Proxy object to override the client http capabilities: http1_override, http2_override
proxies = {
    # Route all traffic through a proxy by default, inherit http1,http2 capabilities from client
    "all://": "http://localhost:8030",
    # But don't use proxies for HTTPS requests to "domain.io"...
    "https://domain.io": None,
    # And use another proxy for requests to "example.com" and its subdomains, only support http1
    "all://*example.com": httpx.Proxy(url="http://localhost:8031", http1_override=True, http2_override=False),
    # And yet another proxy if HTTP is used,
    # and the "internal" subdomain on port 5550 is requested, only support http2 -- prior to knowlegdge
    "http://internal.example.com:5550": httpx.Proxy(url="http://localhost:8032", http1_override=False, http2_override=True),
}

BR,

  • Initially raised as discussion #None

@p1-ra
Copy link
Author

p1-ra commented Dec 23, 2021

@tomchristie @florimondmanca any input/feedbacks regarding this?

I've noticed that encode/httpcore#342 has been closed without comment.

Any reasons to not be able to use HTTP/2 prior to knowledge with proxy?

Does the issue have been resolved elsewhere?

Thanks in advance

@tomchristie
Copy link
Member

Resolved via #2009 and encode/httpcore#468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants