Skip to content

Commit 3a7e6bf

Browse files
committed
Disable http2 extended connect (#178)
### Description Disable http2 extended connect. http2 extended connect was added in x/net 0.33, and go1.24rc1. It breaks websockets. ### Type of change * [ ] New feature * [ ] Feature improvement * [ ] Bug fix * [ ] Documentation * [ ] Cleanup / refactoring * [x] Other (please explain) ### How is this change tested ? * [ ] Unit tests * [x] Manual tests (explain) * [ ] Tests are not needed ### Links to related issues golang/go#71128
1 parent be302bf commit 3a7e6bf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

proxy/proxy.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ var (
102102
errAccessDenied = errors.New("access denied")
103103
)
104104

105+
func init() {
106+
// https://github.com/golang/go/issues/71128
107+
v := os.Getenv("GODEBUG")
108+
if len(v) > 0 {
109+
if strings.Contains(v, "http2xconnect=0") {
110+
return
111+
}
112+
v += ","
113+
}
114+
os.Setenv("GODEBUG", v+"http2xconnect=0")
115+
}
116+
105117
// Proxy receives TLS connections and forwards them to the configured
106118
// backends.
107119
type Proxy struct {

0 commit comments

Comments
 (0)