Header rewrite for proxied requests #32

Merged
mikluko merged 1 commit from feat/header-rewrite into main 2026-10-26 21:03:30 +00:00
Owner

Closes #9.

headers.Rewrite sets, replaces or strips request headers per host pattern. Every matching rule applies, in order. Host patterns use the router's syntax, now exported as router.MatchHost.

The command gains repeatable -set-header HOST=Name: value and -del-header HOST=Name. They apply to plain HTTP and to MITM-intercepted requests; tunnels are opaque and pass unchanged.

The README shows the middleware plugged into MITMHandler.Handler. ExampleRewrite carries the same code, so go test compiles it.

Closes #9. `headers.Rewrite` sets, replaces or strips request headers per host pattern. Every matching rule applies, in order. Host patterns use the router's syntax, now exported as `router.MatchHost`. The command gains repeatable `-set-header HOST=Name: value` and `-del-header HOST=Name`. They apply to plain HTTP and to MITM-intercepted requests; tunnels are opaque and pass unchanged. The README shows the middleware plugged into `MITMHandler.Handler`. `ExampleRewrite` carries the same code, so `go test` compiles it.
Header rewrite for proxied requests
All checks were successful
CI / changelog (pull_request) Successful in 7s
CI / test (pull_request) Successful in 38s
3473d72720
-set-header and -del-header set and strip headers per host pattern, on plain
HTTP and on MITM-intercepted requests. The headers package does the same in
the library; the README shows it plugged into MITMHandler.Handler, and
ExampleRewrite keeps that snippet compiling.

Closes #9
mikluko deleted branch feat/header-rewrite 2026-10-26 21:03:30 +00:00
Sign in to join this conversation.
No description provided.