caddy/modules/caddyhttp
WeidiDeng 14a63a26b9
caddyhttp: use the new http.Protocols to handle h1, h2 and h2c requests (#6961)
* use the new http.Protocols to handle h1, h2 and h2c requests

* fix lint

* keep ConnCtxKey for now

* fix handling for h2c

* check http version while reading the connection

* check if connection implements connectionStater when it should

* add comments about either h1 or h2 must be used in the listener

* fix if check

* return a net.Conn that implements connectionStater if applicable

* remove http/1.1 from alpn if h1 is disabled

* fix matching if only h1 is enabled

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2025-08-22 14:30:42 +00:00
..
caddyauth bcrypt: wrong cost flag name (#7168) 2025-08-11 15:46:32 +03:00
encode use a more modern writing style to simplify code (#7182) 2025-08-20 11:41:21 -06:00
fileserver fileserver: set Range header for precompressed static files to force Content Length header to appear (#7042) 2025-08-22 08:23:13 -06:00
headers chore: fix inconsistent function name in comment (#7174) 2025-08-13 07:05:54 +00:00
intercept intercept: implement Unwrap for interceptedResponseHandler (#7016) 2025-05-12 12:15:34 -06:00
logging
map chore: Use slices package where possible (#6585) 2024-09-25 14:30:56 -06:00
proxyprotocol docs: expand proxy protocol docs (#6620) 2024-10-10 16:21:26 -04:00
push use a more modern writing style to simplify code (#7182) 2025-08-20 11:41:21 -06:00
requestbody requestbody: Fix ContentLength calculation after body replacement (#6896) 2025-03-12 22:18:02 +00:00
reverseproxy reverse_proxy: use the new KeepAliveConfig to set probe interval (#7157) 2025-08-21 14:36:54 -06:00
rewrite chore: upgrade .golangci.yml and workflow to v2 (#6924) 2025-06-03 02:24:32 +03:00
standard
templates chore: fix function in comment (#7121) 2025-07-12 11:54:57 +00:00
tracing tracing: Add spanID field to access logs and http.vars.span_id placeholder (#6646) 2024-10-21 11:06:55 -06:00
app.go caddyhttp: use the new http.Protocols to handle h1, h2 and h2c requests (#6961) 2025-08-22 14:30:42 +00:00
autohttps.go chore: upgrade .golangci.yml and workflow to v2 (#6924) 2025-06-03 02:24:32 +03:00
caddyhttp.go caddyhttp: Add MatchWithError to replace SetVar hack (#6596) 2024-11-04 23:18:50 +00:00
caddyhttp_test.go caddyhttp: Add test cases to corpus (#6374) 2024-06-04 14:23:55 -06:00
celmatcher.go caddyhttp: Add MatchWithError to replace SetVar hack (#6596) 2024-11-04 23:18:50 +00:00
celmatcher_test.go use a more modern writing style to simplify code (#7182) 2025-08-20 11:41:21 -06:00
errors.go
http2listener.go caddyhttp: use the new http.Protocols to handle h1, h2 and h2c requests (#6961) 2025-08-22 14:30:42 +00:00
httpredirectlistener.go
invoke.go
ip_matchers.go caddyhttp: refactor to use reflect.TypeFor (#7187) 2025-08-18 17:08:46 -06:00
ip_range.go Move PrivateRangesCIDR() back: add a pass-through function (#6514) 2024-08-12 05:47:05 -04:00
logging.go Revert "logging: Always set fields func; fix #6829" 2025-02-07 06:23:43 -07:00
marshalers.go caddyhttp: Allow matching Transfer-Encoding, add to access logs (#6629) 2024-12-20 11:16:34 -07:00
matchers.go caddyhttp: refactor to use reflect.TypeFor (#7187) 2025-08-18 17:08:46 -06:00
matchers_test.go use a more modern writing style to simplify code (#7182) 2025-08-20 11:41:21 -06:00
metrics.go metrics: move metrics up, outside servers (#6606) 2024-10-18 09:54:21 -06:00
metrics_test.go chore: upgrade .golangci.yml and workflow to v2 (#6924) 2025-06-03 02:24:32 +03:00
replacer.go chore: upgrade .golangci.yml and workflow to v2 (#6924) 2025-06-03 02:24:32 +03:00
replacer_test.go
responsematchers.go caddyhttp: Allow matching Transfer-Encoding, add to access logs (#6629) 2024-12-20 11:16:34 -07:00
responsematchers_test.go
responsewriter.go caddyhttp: ResponseRecorder sets stream regardless of 1xx 2025-01-27 08:18:37 -07:00
responsewriter_test.go
routes.go caddyhttp: Add MatchWithError to replace SetVar hack (#6596) 2024-11-04 23:18:50 +00:00
server.go caddyhttp: use the new http.Protocols to handle h1, h2 and h2c requests (#6961) 2025-08-22 14:30:42 +00:00
server_test.go use a more modern writing style to simplify code (#7182) 2025-08-20 11:41:21 -06:00
staticerror.go caddyhttp: run error (msg) through replacer (#6536) 2024-08-22 11:32:44 -06:00
staticresp.go Use slices.Contains to simplify code (#7039) 2025-05-31 12:03:06 -06:00
staticresp_test.go
subroute.go
vars.go caddyhttp: refactor to use reflect.TypeFor (#7187) 2025-08-18 17:08:46 -06:00