From: Matt Holt Date: Thu, 29 Sep 2022 18:42:00 +0000 (-0600) Subject: HTTP3.md: update Caddy example X-Git-Tag: curl-7_86_0~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16a3ed40380ca678287f67dd65afe2d1164d704e;p=thirdparty%2Fcurl.git HTTP3.md: update Caddy example Closes #9623 --- diff --git a/docs/HTTP3.md b/docs/HTTP3.md index 16202b78c8..26141bb75f 100644 --- a/docs/HTTP3.md +++ b/docs/HTTP3.md @@ -291,26 +291,21 @@ that exists in curl's test dir. ### Caddy -[Install Caddy](https://caddyserver.com/docs/install), you can even put the -single binary in a separate directory if you prefer. +[Install Caddy](https://caddyserver.com/docs/install). For easiest use, the binary +should be either in your PATH or your current directory. -In the same directory you put Caddy, create a `Caddyfile` with the following -content to run an HTTP/3 reverse-proxy on port 7443: +Create a `Caddyfile` with the following content: ~~~ -{ - auto_https disable_redirects - servers :7443 { - protocol { - experimental_http3 - } - } -} - localhost:7443 { - reverse_proxy localhost:80 + respond "Hello, world! You're using {http.request.proto}" } ~~~ Then run Caddy: ./caddy start + +Making requests to `https://localhost:7443` should tell you which protocol is being used. + +You can change the hard-coded response to something more useful by replacing `respond` +with `reverse_proxy` or `file_server`, for example: `reverse_proxy localhost:80`