From d608c67791deea56ceebc2508c1cbe52c5d4524d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 23 Nov 2023 19:36:46 -0300 Subject: [PATCH] store websocket object under WS_KEY at the connection context. --- handlers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handlers.go b/handlers.go index bcd6afa..9b117e8 100644 --- a/handlers.go +++ b/handlers.go @@ -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() {