diff --git a/clients.go b/clients.go index 80c2e89..a880671 100644 --- a/clients.go +++ b/clients.go @@ -23,6 +23,7 @@ var ( primalWeb = ClientReference{ID: "primal", Name: "Primal", Base: "https://primal.net/e/{code}", Platform: "web"} nostrudel = ClientReference{ID: "nostrudel", Name: "Nostrudel", Base: "https://nostrudel.ninja/#/n/{code}", Platform: "web"} nostter = ClientReference{ID: "nostter", Name: "Nostter", Base: "https://nostter.app/{code}", Platform: "web"} + nostterRelay = ClientReference{ID: "nostter", Name: "Nostter", Base: "https://nostter.app/relays/{code}", Platform: "web"} iris = ClientReference{ID: "iris", Name: "Iris", Base: "https://iris.to/{code}", Platform: "web"} coracle = ClientReference{ID: "coracle", Name: "Coracle", Base: "https://coracle.social/{code}", Platform: "web"} coracleRelay = ClientReference{ID: "coracle", Name: "Coracle", Base: "https://coracle.social/relays/{code}", Platform: "web"} @@ -66,7 +67,7 @@ func generateClientList( case -1: // relays clients = []ClientReference{ native, - coracleRelay, nostrrrRelay, + nostterRelay, coracleRelay, nostrrrRelay, } case 1, 6: clients = []ClientReference{ diff --git a/render_relay.go b/render_relay.go index fc800ae..86d6ff4 100644 --- a/render_relay.go +++ b/render_relay.go @@ -2,6 +2,7 @@ package main import ( "net/http" + "net/url" "strings" "time" @@ -97,7 +98,12 @@ func renderRelayPage(w http.ResponseWriter, r *http.Request) { Proxy: "https://" + hostname + "/njump/proxy?src=", LastNotes: renderableLastNotes, ModifiedAt: lastEventAt.Format("2006-01-02T15:04:05Z07:00"), - Clients: generateClientList(-1, hostname), + Clients: generateClientList(-1, hostname, func(cr ClientReference, s string) string { + if cr == nostterRelay { + return strings.Replace(s, hostname, url.PathEscape("wss://"+hostname), 1) + } + return s + }), }).Render(r.Context(), w) } }