Skip to content

Commit

Permalink
Disable http2 extended connect (#178)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
rthellend authored Jan 8, 2025
1 parent a7ad417 commit eb8835a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ var (
errAccessDenied = errors.New("access denied")
)

func init() {
// https://github.com/golang/go/issues/71128
v := os.Getenv("GODEBUG")
if len(v) > 0 {
if strings.Contains(v, "http2xconnect=0") {
return
}
v += ","
}
os.Setenv("GODEBUG", v+"http2xconnect=0")
}

// Proxy receives TLS connections and forwards them to the configured
// backends.
type Proxy struct {
Expand Down

0 comments on commit eb8835a

Please sign in to comment.