From 7fba76d7e4e63e0c29da81d6be43330743af1aaf Mon Sep 17 00:00:00 2001 From: bndw Date: Sun, 8 Feb 2026 10:25:39 -0800 Subject: 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. --- relay_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'relay_test.go') diff --git a/relay_test.go b/relay_test.go index b39aa06..38b2062 100644 --- a/relay_test.go +++ b/relay_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" - "github.com/coder/websocket" + "northwest.io/nostr/internal/websocket" ) // mockRelay creates a test WebSocket server that echoes messages func mockRelay(t *testing.T, handler func(conn *websocket.Conn)) *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - conn, err := websocket.Accept(w, r, nil) + conn, err := websocket.Accept(w, r) if err != nil { t.Logf("Failed to accept WebSocket: %v", err) return @@ -77,7 +77,7 @@ func TestRelaySendReceive(t *testing.T) { ctx := context.Background() // Create relay without auto-Listen to test Send/Receive directly - conn, _, err := websocket.Dial(ctx, url, nil) + conn, err := websocket.Dial(ctx, url) if err != nil { t.Fatalf("Dial() error = %v", err) } -- cgit v1.2.3