caddy/modules/caddyhttp/reverseproxy
tomholford 43adbee168 caddyhttp, reverseproxy: gate WebTransport behind enable_webtransport server flag
steadytao raised an architectural concern in review of #7669: the PR
put experimental WebTransport handling directly into Caddy's core
HTTP/3 accept path, so every HTTP/3 deployment paid for the feature
whether or not they used it.

Collapse the enablement surface to a single server-level opt-in that
matches Caddy's existing precedent for protocol-level features
(`protocols`, `allow_0rtt`, `enable_full_duplex`), and detect the
request shape at the handler the same way `reverse_proxy` detects a
WebSocket upgrade today — no per-handler config flag.

Core HTTP/3 path changes (modules/caddyhttp/server.go):
  * New `EnableWebTransport bool` field on Server, marked EXPERIMENTAL.
  * buildHTTP3Server now only calls webtransport.ConfigureHTTP3Server
    and sets EnableStreamResetPartialDelivery when the flag is true.
    When false, the constructed http3.Server is bit-for-bit identical
    to the pre-WebTransport implementation.
  * wtServer is constructed only when the flag is true.
  * serveH3AcceptLoop falls back to http3.Server.ServeListener when
    the flag is false — no varint peek, no per-connection dispatch.

Caddyfile wiring (caddyconfig/httpcaddyfile/serveroptions.go):
  * New `enable_webtransport` global server option, modeled on
    `enable_full_duplex`.

Reverse-proxy simplifications (modules/caddyhttp/reverseproxy/):
  * Removed HTTPTransport.WebTransport field and its Provision-time
    exclusivity check (no longer needed; H3 is validated separately).
  * Removed the `webtransport` Caddyfile subdirective under
    `transport http { }` — this neutralizes the prior commit that
    introduced it.
  * Removed Handler.webtransportEnabled cache. ServeHTTP now branches
    on isWebTransportExtendedConnect(r) alone, matching how the
    WebSocket upgrade branch works.
  * serveWebTransport gains fail-fast guards with clear errors when
    the parent server has enable_webtransport=false or when the
    handler's transport does not include HTTP/3.

Tests:
  * Existing TestServer_BuildHTTP3ServerEnablesWebTransport now sets
    EnableWebTransport=true explicitly; new
    TestServer_BuildHTTP3ServerWithoutWebTransport locks in the
    regression guard that flag-off produces the pre-PR http3.Server.
  * Integration tests updated: enable_webtransport: true added to
    every H3 server block; "webtransport": true dropped from the
    reverse_proxy transport JSON (auto-detected now).
  * Caddyfile adapt test for the deleted `webtransport` subdirective
    is removed; `enable_webtransport` is added to the existing
    global_server_options_single adapt test alongside its peers.

No runtime behavior change when enable_webtransport is false. Diff
against master on the core HTTP/3 path is effectively zero in that
configuration.
2026-06-23 19:04:24 +09:00
..
fastcgi Merge commit from fork 2026-05-29 11:37:17 -06:00
forwardauth forwardauth: error on duplicate uri subdirective (#7814) 2026-06-10 23:31:04 -04:00
addresses.go core: Implement socket activation listeners (#6573) 2024-09-30 10:55:03 -06:00
addresses_test.go reverseproxy: do not parse upstream address too early if it contains replaceble parts (#5695) 2023-08-05 23:30:02 +02:00
admin.go reverseproxy: Track dynamic upstreams, enable passive healthchecking (#7539) 2026-03-04 15:05:26 -05:00
admin_test.go reverseproxy: Track dynamic upstreams, enable passive healthchecking (#7539) 2026-03-04 15:05:26 -05:00
ascii.go reverseproxy: Sync up handleUpgradeResponse with stdlib (#4664) 2022-04-11 12:49:56 -06:00
ascii_test.go filesystem: Globally declared filesystems, fs directive (#5833) 2024-01-13 20:12:43 +00:00
buffering_test.go reverseproxy: more comments about buffering and add new tests (#6778) 2025-03-07 11:22:43 -07:00
caddyfile.go caddyhttp, reverseproxy: gate WebTransport behind enable_webtransport server flag 2026-06-23 19:04:24 +09:00
client_disconnect_test.go reverseproxy: log status 499 instead of 0 when client disconnects (#7827) 2026-06-18 13:31:02 +10:00
command.go cmd: prevent commas in header values from being split (#7268) 2025-09-22 21:12:06 -06:00
copyresponse.go reverseproxy: Fix double headers in response handlers (#4847) 2022-06-22 15:10:14 -04:00
dynamic_upstreams_test.go reverseproxy: Track dynamic upstreams, enable passive healthchecking (#7539) 2026-03-04 15:05:26 -05:00
headers_test.go chore: replace interface{} with any for modernization (#7571) 2026-04-11 19:53:12 +03:00
healthchecks.go chore: clean up wording and typo fixes (#7745) 2026-05-20 16:36:30 +10:00
hopheaders_test.go Merge commit from fork 2026-06-12 12:39:01 -06:00
hosts.go admin: Redact sensitive request headers in API logs (#7578) 2026-04-17 14:56:42 -06:00
httptransport.go caddyhttp, reverseproxy: gate WebTransport behind enable_webtransport server flag 2026-06-23 19:04:24 +09:00
httptransport_test.go reverseproxy: Add regression test for DialInfo network override (#7758) 2026-05-20 09:43:58 -04:00
metrics.go reverseproxy: ignore duplicate collector registration error (#6820) 2025-02-04 10:55:30 +03:00
passive_health_test.go reverseproxy: Track dynamic upstreams, enable passive healthchecking (#7539) 2026-03-04 15:05:26 -05:00
retries_test.go reverseproxy: further prevent body closes from dial errors (#7715) 2026-05-12 12:05:50 -06:00
reverseproxy.go caddyhttp, reverseproxy: gate WebTransport behind enable_webtransport server flag 2026-06-23 19:04:24 +09:00
selectionpolicies.go reverseproxy: validate on weighted_round_robin loadbalancing policy (#7807) 2026-06-08 02:18:20 +10:00
selectionpolicies_test.go reverseproxy: validate on weighted_round_robin loadbalancing policy (#7807) 2026-06-08 02:18:20 +10:00
streaming.go reverseproxy: make stream copy buffer size configurable (#7627) 2026-04-10 14:49:32 -06:00
streaming_test.go reverseproxy: make stream copy buffer size configurable (#7627) 2026-04-10 14:49:32 -06:00
upstreams.go reverseproxy: Add ability to clear dynamic upstreams cache during retries (#7662) 2026-04-28 09:16:18 -06:00
upstreams_test.go chore: upgrade .golangci.yml and workflow to v2 (#6924) 2025-06-03 02:24:32 +03:00
webtransport_pump.go reverseproxy: add WebTransport session pump 2026-06-23 19:04:23 +09:00
webtransport_pump_test.go reverseproxy: add WebTransport session pump 2026-06-23 19:04:23 +09:00
webtransport_transport.go caddyhttp, reverseproxy: gate WebTransport behind enable_webtransport server flag 2026-06-23 19:04:24 +09:00
webtransport_transport_test.go reverseproxy: add WebTransport upstream dialer helper 2026-06-23 19:04:23 +09:00