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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTP3 support (experimental) #7724

Merged
merged 11 commits into from Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/content/reference/static-configuration/cli-ref.md
Expand Up @@ -102,6 +102,9 @@ Entry points definition. (Default: ```false```)
`--entrypoints.<name>.address`:
Entry point address.

`--entrypoints.<name>.enablehttp3`:
Enable HTTP3. (Default: ```false```)

`--entrypoints.<name>.forwardedheaders.insecure`:
Trust all forwarded headers. (Default: ```false```)

Expand Down Expand Up @@ -174,6 +177,9 @@ plugin's GOPATH.
`--experimental.devplugin.modulename`:
plugin's module name.

`--experimental.http3`:
Enable HTTP3. (Default: ```false```)

`--experimental.kubernetesgateway`:
Allow the Kubernetes gateway api provider usage. (Default: ```false```)

Expand Down
6 changes: 6 additions & 0 deletions docs/content/reference/static-configuration/env-ref.md
Expand Up @@ -102,6 +102,9 @@ Entry points definition. (Default: ```false```)
`TRAEFIK_ENTRYPOINTS_<NAME>_ADDRESS`:
Entry point address.

`TRAEFIK_ENTRYPOINTS_<NAME>_ENABLEHTTP3`:
Enable HTTP3. (Default: ```false```)

`TRAEFIK_ENTRYPOINTS_<NAME>_FORWARDEDHEADERS_INSECURE`:
Trust all forwarded headers. (Default: ```false```)

Expand Down Expand Up @@ -174,6 +177,9 @@ plugin's GOPATH.
`TRAEFIK_EXPERIMENTAL_DEVPLUGIN_MODULENAME`:
plugin's module name.

`TRAEFIK_EXPERIMENTAL_HTTP3`:
Enable HTTP3. (Default: ```false```)

`TRAEFIK_EXPERIMENTAL_KUBERNETESGATEWAY`:
Allow the Kubernetes gateway api provider usage. (Default: ```false```)

Expand Down
2 changes: 2 additions & 0 deletions docs/content/reference/static-configuration/file.toml
Expand Up @@ -14,6 +14,7 @@
[entryPoints]
[entryPoints.EntryPoint0]
address = "foobar"
enableHTTP3 = true
[entryPoints.EntryPoint0.transport]
[entryPoints.EntryPoint0.transport.lifeCycle]
requestAcceptGraceTimeout = 42
Expand Down Expand Up @@ -390,4 +391,5 @@
[experimental.devPlugin]
goPath = "foobar"
moduleName = "foobar"
http3 = true
kubernetesGateway = true
2 changes: 2 additions & 0 deletions docs/content/reference/static-configuration/file.yaml
Expand Up @@ -32,6 +32,7 @@ entryPoints:
trustedIPs:
- foobar
- foobar
enableHTTP3: true
http:
redirections:
entryPoint:
Expand Down Expand Up @@ -410,5 +411,6 @@ experimental:
devPlugin:
goPath: foobar
moduleName: foobar
http3: true
kubernetesGateway: true

40 changes: 40 additions & 0 deletions docs/content/routing/entrypoints.md
Expand Up @@ -100,6 +100,7 @@ They can be defined by using a file (TOML or YAML) or CLI arguments.
[entryPoints]
[entryPoints.name]
address = ":8888" # same as ":8888/tcp"
enableHTTP3 = true
[entryPoints.name.transport]
[entryPoints.name.transport.lifeCycle]
requestAcceptGraceTimeout = 42
Expand All @@ -121,6 +122,7 @@ They can be defined by using a file (TOML or YAML) or CLI arguments.
entryPoints:
name:
address: ":8888" # same as ":8888/tcp"
enableHTTP3: true
transport:
lifeCycle:
requestAcceptGraceTimeout: 42
Expand All @@ -144,6 +146,7 @@ They can be defined by using a file (TOML or YAML) or CLI arguments.
```bash tab="CLI"
## Static configuration
--entryPoints.name.address=:8888 # same as :8888/tcp
--entryPoints.name.http3=true
--entryPoints.name.transport.lifeCycle.requestAcceptGraceTimeout=42
--entryPoints.name.transport.lifeCycle.graceTimeOut=42
--entryPoints.name.transport.respondingTimeouts.readTimeout=42
Expand Down Expand Up @@ -218,6 +221,43 @@ If both TCP and UDP are wanted for the same port, two entryPoints definitions ar

Full details for how to specify `address` can be found in [net.Listen](https://golang.org/pkg/net/#Listen) (and [net.Dial](https://golang.org/pkg/net/#Dial)) of the doc for go.

### EnableHTTP3

`enableHTTP3` defines that you want to enable HTTP3 on this `address`.
You can only enable HTTP3 on a TCP entrypoint.
Enabling HTTP3 will automatically add the correct headers for the connection upgrade to HTTP3.

??? info "HTTP3 uses UDP+TLS"

As HTTP3 uses UDP, you can't have a TCP entrypoint with HTTP3 on the same port as a UDP entrypoint.
Since HTTP3 requires the use of TLS, only routers with TLS enabled will be usable with HTTP3.

!!! warning "Enabling Experimental HTTP3"

As the HTTP3 spec is still in draft, HTTP3 support in Traefik is an experimental feature and needs to be activated
in the experimental section of the static configuration.

```toml tab="File (TOML)"
[experimental]
http3 = true

[entryPoints.name]
enableHTTP3 = true
```

```yaml tab="File (YAML)"
experimental:
http3: true

entryPoints:
name:
enableHTTP3: true
```

```bash tab="CLI"
--experimental.http3=true --entrypoints.name.enablehttp3=true
```

### Forwarded Headers

You can configure Traefik to trust the forwarded headers information (`X-Forwarded-*`).
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -30,12 +30,11 @@ require (
github.com/eapache/channels v1.1.0
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/fatih/structs v1.1.0
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/gambol99/go-marathon v0.0.0-20180614232016-99a156b96fb2
github.com/go-acme/lego/v4 v4.1.3
github.com/go-check/check v0.0.0-00010101000000-000000000000
github.com/go-kit/kit v0.10.1-0.20200915143503-439c4d2ed3ea
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.4.3
github.com/google/go-github/v28 v28.1.1
github.com/gorilla/mux v1.7.3
github.com/gorilla/websocket v1.4.2
Expand All @@ -47,6 +46,7 @@ require (
github.com/libkermit/compose v0.0.0-20171122111507-c04e39c026ad
github.com/libkermit/docker v0.0.0-20171122101128-e6674d32b807
github.com/libkermit/docker-check v0.0.0-20171122104347-1113af38e591
github.com/lucas-clemente/quic-go v0.19.3
github.com/magiconair/properties v1.8.1 // indirect
github.com/mailgun/ttlmap v0.0.0-20170619185759-c1c17f74874f
github.com/miekg/dns v1.1.31
Expand Down