mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-28 04:39:52 +00:00
reverseproxy: add webtransport Caddyfile subdirective
Adds a `webtransport` subdirective to the `transport http {}` block of
reverse_proxy that sets the new WebTransport bool on the transport.
Takes no arguments; exclusivity with versions 3 is enforced at
Provision time so parse order doesn't matter.
Example:
reverse_proxy https://backend:9443 {
transport http {
versions 3
webtransport
tls_insecure_skip_verify
}
}
Includes a Caddyfile-to-JSON adapt test round-tripping the new
subdirective.
This commit is contained in:
parent
1998be8e4d
commit
bcc6f03196
2 changed files with 56 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
:8443
|
||||
|
||||
reverse_proxy https://backend:9443 {
|
||||
transport http {
|
||||
versions 3
|
||||
webtransport
|
||||
tls_insecure_skip_verify
|
||||
}
|
||||
}
|
||||
----------
|
||||
{
|
||||
"apps": {
|
||||
"http": {
|
||||
"servers": {
|
||||
"srv0": {
|
||||
"listen": [
|
||||
":8443"
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
"handle": [
|
||||
{
|
||||
"handler": "reverse_proxy",
|
||||
"transport": {
|
||||
"protocol": "http",
|
||||
"tls": {
|
||||
"insecure_skip_verify": true
|
||||
},
|
||||
"versions": [
|
||||
"3"
|
||||
],
|
||||
"webtransport": true
|
||||
},
|
||||
"upstreams": [
|
||||
{
|
||||
"dial": "backend:9443"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1315,6 +1315,15 @@ func (h *HTTPTransport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
|||
return d.ArgErr()
|
||||
}
|
||||
|
||||
case "webtransport":
|
||||
// Accepts no arguments: `webtransport` alone enables it.
|
||||
// Exclusivity with `versions 3` is enforced at Provision
|
||||
// time so parsing is order-independent.
|
||||
if d.NextArg() {
|
||||
return d.Errf("webtransport does not take arguments")
|
||||
}
|
||||
h.WebTransport = true
|
||||
|
||||
case "compression":
|
||||
if d.NextArg() {
|
||||
if d.Val() == "off" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue