From a5dc827e150097e19d02ade504e1351eb37a93b7 Mon Sep 17 00:00:00 2001 From: mleku Date: Sun, 14 Dec 2025 08:20:09 +0100 Subject: [PATCH] Fix NIP-11 fetch URL scheme conversion for non-proxied relays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert wss:// to https:// and ws:// to http:// before fetching NIP-11 documents, fixing failures for users not using HTTPS upgrade proxies - The fetchNIP11 function was using WebSocket URLs directly for HTTP requests, causing scheme mismatch errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- pkg/sync/nip11.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/sync/nip11.go b/pkg/sync/nip11.go index dfbfb7f..76da747 100644 --- a/pkg/sync/nip11.go +++ b/pkg/sync/nip11.go @@ -69,8 +69,11 @@ func (c *NIP11Cache) Get(ctx context.Context, relayURL string) (*relayinfo.T, er // fetchNIP11 fetches relay information document from a given URL func (c *NIP11Cache) fetchNIP11(ctx context.Context, relayURL string) (*relayinfo.T, error) { - // Construct NIP-11 URL + // Convert WebSocket URL to HTTP URL for NIP-11 fetch + // wss:// -> https://, ws:// -> http:// nip11URL := relayURL + nip11URL = strings.Replace(nip11URL, "wss://", "https://", 1) + nip11URL = strings.Replace(nip11URL, "ws://", "http://", 1) if !strings.HasSuffix(nip11URL, "/") { nip11URL += "/" }