feat: add custom header support to PHT protocol

- Add Header field to PHT Client and clientConn structs
- Support custom headers in authorize, push, and pull requests
- Add metadata parsing for header configuration as map[string]string
- Enables PHT usage with header-based authentication (e.g., Cloudflare Access)

Backwards compatible - headers are optional.
This commit is contained in:
Vasileios Papadimas
2026-01-16 14:35:48 +02:00
committed by ginuerzh
parent cd7bf9521f
commit 96f35bd7aa
4 changed files with 44 additions and 0 deletions
+1
View File
@@ -109,6 +109,7 @@ func (d *phtDialer) Dial(ctx context.Context, addr string, opts ...dialer.DialOp
PushPath: d.md.pushPath,
PullPath: d.md.pullPath,
TLSEnabled: d.tlsEnabled,
Header: d.md.header,
Logger: d.options.Logger,
}
d.clients[addr] = client