store websocket object under WS_KEY at the connection context.

This commit is contained in:
fiatjaf
2023-11-23 19:36:46 -03:00
parent c0069f1e1b
commit d608c67791

View File

@@ -49,6 +49,8 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
WaitingForAuth: make(chan struct{}),
}
ctx = context.WithValue(ctx, WS_KEY, ws)
// reader
go func() {
defer func() {