diff --git a/websocket.go b/websocket.go
index 8b4c86d05cc1fb9ff82ed24e30480f7daba32ced..3b2a48716d47638aadac3fe832efab3eca474900 100644
--- a/websocket.go
+++ b/websocket.go
@@ -160,10 +160,10 @@ func heartbeat(ctx context.Context, c *websocket.Conn, d time.Duration) {
 func newWebsocketCodec(ctx context.Context, c *websocket.Conn, host string, req http.Header) ServerCodec {
 	c.SetReadLimit(wsMessageSizeLimit)
 	jsonWriter := func(v any) error {
-		return wsjson.Write(ctx, c, v)
+		return wsjson.Write(context.Background(), c, v)
 	}
 	jsonReader := func(v any) error {
-		return wsjson.Read(ctx, c, v)
+		return wsjson.Read(context.Background(), c, v)
 	}
 	conn := websocket.NetConn(ctx, c, websocket.MessageText)
 	wc := &websocketCodec{