fix(reverseproxy): align forwarding and tunnel semantics

This commit is contained in:
wjqserver 2026-04-02 03:18:49 +08:00
parent c019f24e99
commit ed44c592d3
6 changed files with 864 additions and 26 deletions

2
ecw.go
View file

@ -197,7 +197,7 @@ func (ecw *errorCapturingResponseWriter) Written() bool {
func (ecw *errorCapturingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
hijacker, ok := ecw.w.(http.Hijacker)
if !ok {
return nil, nil, errors.New("the underlying ResponseWriter does not support the Hijacker interface")
return nil, nil, http.ErrNotSupported
}
return hijacker.Hijack()
}