From 30e0e1040a8ee667508a538ac896d24f6ceaa8cd Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 30 Mar 2023 18:26:43 -0300 Subject: [PATCH] use context passed to .Connect() for the live of the relay. --- relay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay.go b/relay.go index a2e4781..7653077 100644 --- a/relay.go +++ b/relay.go @@ -73,7 +73,7 @@ func (r *Relay) String() string { // Once successfully connected, context expiration has no effect: call r.Close // to close the connection. func (r *Relay) Connect(ctx context.Context) error { - connectionContext, cancel := context.WithCancel(context.Background()) + connectionContext, cancel := context.WithCancel(ctx) r.ConnectionContext = connectionContext if r.URL == "" {