summaryrefslogtreecommitdiffstats
path: root/relay.go
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-08 10:25:39 -0800
committerbndw <ben@bdw.to>2026-02-08 10:25:39 -0800
commit7fba76d7e4e63e0c29da81d6be43330743af1aaf (patch)
tree97d20b9d8a077cabdf3e693af64b9fd13e77f736 /relay.go
parente79f9ad89556000521b43ce5ff4eb59dd00768b0 (diff)
fix: correct WebSocket GUID constant (RFC 6455)
Fixed typo in WebSocket GUID that was causing handshake failures. The GUID had '5AB5' instead of 'C5AB0' in the middle section. Correct value: 258EAFA5-E914-47DA-95CA-C5AB0DC85B11 This also includes the implementation of an internal WebSocket client to replace the external dependency, providing a minimal implementation tailored for Nostr relay connections.
Diffstat (limited to 'relay.go')
-rw-r--r--relay.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/relay.go b/relay.go
index bda76af..b34a61d 100644
--- a/relay.go
+++ b/relay.go
@@ -6,7 +6,7 @@ import (
6 "fmt" 6 "fmt"
7 "sync" 7 "sync"
8 8
9 "github.com/coder/websocket" 9 "northwest.io/nostr/internal/websocket"
10) 10)
11 11
12// Relay represents a connection to a Nostr relay. 12// Relay represents a connection to a Nostr relay.
@@ -24,7 +24,7 @@ type Relay struct {
24 24
25// Connect establishes a WebSocket connection to the relay. 25// Connect establishes a WebSocket connection to the relay.
26func Connect(ctx context.Context, url string) (*Relay, error) { 26func Connect(ctx context.Context, url string) (*Relay, error) {
27 conn, _, err := websocket.Dial(ctx, url, nil) 27 conn, err := websocket.Dial(ctx, url)
28 if err != nil { 28 if err != nil {
29 return nil, fmt.Errorf("failed to connect to relay: %w", err) 29 return nil, fmt.Errorf("failed to connect to relay: %w", err)
30 } 30 }