Replace Websocket library
We are using https://pkg.go.dev/golang.org/x/net/websocket, which is poorly maintained.
Better options are:
- https://pkg.go.dev/github.com/gorilla/websocket
- https://pkg.go.dev/nhooyr.io/websocket
Ideally we would be able to support Websockets over h2 and even h3, for multiplexing and better performance.
However, it's not clear any implementation can support it yet, given limitations in the http2 support in Go:
- https://github.com/golang/go/issues/53209
- https://github.com/golang/go/issues/49918
Oh, neither of the libraries support h2 :-/
- https://github.com/nhooyr/websocket/issues/4
- https://github.com/gorilla/websocket/issues/417
We can consider adding h3 support with quic-go: https://quic-go.net/docs/webtransport/
We can consider adding h3 support with quic-go: https://quic-go.net/docs/webtransport/
There are RFC 9220, websocket over http/3.
I have implemented in nginx, make nginx support proxy http2/http3 websocket to websocket 1.1 backend. And even make a simple client to use, as a sip003 plugin.