diff options
| author | bndw <ben@bdw.to> | 2026-02-08 10:25:39 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-08 10:25:39 -0800 |
| commit | 7fba76d7e4e63e0c29da81d6be43330743af1aaf (patch) | |
| tree | 97d20b9d8a077cabdf3e693af64b9fd13e77f736 /relay.go | |
| parent | e79f9ad89556000521b43ce5ff4eb59dd00768b0 (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.go | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -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. |
| 26 | func Connect(ctx context.Context, url string) (*Relay, error) { | 26 | func 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 | } |
