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

Support HTTP/3 #80

Merged
merged 1 commit into from
Jun 7, 2021
Merged

Support HTTP/3 #80

merged 1 commit into from
Jun 7, 2021

Conversation

klzgrad
Copy link
Contributor

@klzgrad klzgrad commented Oct 2, 2020

Though the patch is small it's not easy to test it because the pieces for H/3 have yet to fall in place.

First build Caddy with this PR. Then Caddyfile:

{
  experimental_http3
}
:443, example.com
tls [email protected]
route {
  forward_proxy {
    basic_auth user pass
    hide_ip
    hide_via
    probe_resistance secret.com
  }
  file_server {
    root /var/www/html
  }
}

Then

google-chrome --enable-quic --quic-version=h3-29 --proxy-server=quic://example.com secret.com

which prompts for password. After that you should be able to open http://example.com. Caddy should print a message like this:

2020/10/02 01:23:45.678 ERROR http.log.error Proxy-Authorization is required! Expected format: <type> <credentials>{"request": {"remote_addr": "1.2.3.4:5678", "proto": "HTTP/3", "method": "GET", "host": "secret.com", "uri": "/", "headers": {"Upgrade-Insecure-Requests": ["1"], "User-Agent": ["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"], "Accept-Encoding": ["gzip, deflate"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 0, "cipher_suite": 0, "proto": "", "proto_mutual": false, "server_name": ""}}, "duration": 0.000106268}

I have a patch with quic-go v.0.18.0 quic-go/quic-go@c81eeb8 to enable the CONNECT method. But Chrome has disabled QUIC proxying for any https origins and I haven't found the right parameters to turn it back on for this test. But my other customized proxy tool based on Chrome stack does work with HTTP/3 CONNECT in Caddy. This should make sense because the test above already shows GET requests get proxied correctly.

@mholt
Copy link
Member

mholt commented Oct 2, 2020

Cool, thanks for the PR! I think this is worth a shot. But @sergeyfrolov would have a chance to chime in, I think he'll have a better understanding of the privacy/probe-resistance implications.

@sergeyfrolov
Copy link
Member

Thanks for the PR @klzgrad!
Too bad Google Chrome does not allow QUIC proxying at this time. Do you have a link to your client?

@mholt this PR does not seem to impact the probe-resistance. However, I could imagine that using traffic analysis to detect the use of proxy with QUIC could be slightly more accurate than with HTTP/2. We should still proceed with the optional QUIC proxying, if we can, because it should provide a noticeable performance boost.

I am curious if our friends at Google (@bemasc @fortuna @dalyk) are interested in QUIC proxying, in particular, with Google Chrome as a client?

@bemasc
Copy link

bemasc commented Dec 5, 2020 via email

@klzgrad
Copy link
Contributor Author

klzgrad commented Dec 9, 2020

@sergeyfrolov https://github.com/klzgrad/naiveproxy It's essentially a minimized Chromium net stack, so I can turn QUIC proxy support back on.

using traffic analysis to detect the use of proxy with QUIC could be slightly more accurate than with HTTP/2

Can you explain why this is the case?

@klzgrad
Copy link
Contributor Author

klzgrad commented Jan 30, 2021

Right there is a report of website fingerprinting of QUIC without padding https://arxiv.org/abs/2101.11871, but I don't get why QUIC is slightly more prone to traffic classification than HTTP/2.

@sergeyfrolov
Copy link
Member

sergeyfrolov commented Mar 25, 2021 via email

@klzgrad
Copy link
Contributor Author

klzgrad commented Mar 27, 2021

It's expected for unpadded QUIC traffic to be fingerprinted on the same level of accuracy as HTTP/2 as they are both designed to have minimal delay so there's little room for the packet pattern to change.

@mholt mholt merged commit 7b288bc into caddyserver:caddy2 Jun 7, 2021
@mholt
Copy link
Member

mholt commented Jun 7, 2021

Ok, great, let's try it out. Thanks!

@klzgrad klzgrad deleted the caddy2-h3 branch June 11, 2021 00:06
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