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

使http outbound支持连接https与http/2代理服务器 #18

Merged
merged 1 commit into from
Jun 25, 2020
Merged

使http outbound支持连接https与http/2代理服务器 #18

merged 1 commit into from
Jun 25, 2020

Conversation

darhwa
Copy link
Contributor

@darhwa darhwa commented Jun 11, 2020

@kslr
Copy link
Contributor

kslr commented Jun 20, 2020

Please update the code

1. Enables http outbound to set up a HTTP tunnel above HTTP/1.1,
  HTTP/1.1 over TLS, or HTTP/2 over TLS. Previously it only works for
  plain HTTP/1.1
2. In setting up CONNECT tunnel, replaces handcrafted request with
  standard http.Request
@darhwa
Copy link
Contributor Author

darhwa commented Jun 20, 2020

Have rebased upon current master.

@kslr kslr requested review from vcptr and xiaokangwang June 20, 2020 15:40
Copy link
Contributor

@vcptr vcptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good to me.

I see description mentioned only Caddy with ForwardProxy, how about tests with
some other common http server like Squid, Privoxy.

@darhwa
Copy link
Contributor Author

darhwa commented Jun 20, 2020

@vcptr

Squid or Privoxy, in my knowledge, doesn't yet support CONNECT tunnel over H2. Squid has a wiki page saying it's in designing phase(https://wiki.squid-cache.org/Features/HTTP2). My patch can handle both HTTP/1.1 and H2, so it still works with Squid/Privoxy as before.

Besides Caddy forwardproxy, HAProxy also support H2 CONNECT method. So in theory any HTTP proxy server can support H2 by simply fronting it with a HAProxy. I've tested it with HAProxy + tinyproxy and it works fine. There is a sample HAProxy config for this purpose at https://github.com/klzgrad/naiveproxy/wiki/HAProxy-Setup

Copy link
Contributor

@xiaokangwang xiaokangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this PR is ready to be merged. However, Http2 proxy currently does not have any test and is a user-facing feature, which can be troublesome if we want to modify it later.

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.

4 participants