add nostter as relay browser.

This commit is contained in:
fiatjaf
2024-10-26 18:59:40 -03:00
parent 69b9b96623
commit 7a13de6383
2 changed files with 9 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ var (
primalWeb = ClientReference{ID: "primal", Name: "Primal", Base: "https://primal.net/e/{code}", Platform: "web"} 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"} 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"} 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"} 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"} 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"} coracleRelay = ClientReference{ID: "coracle", Name: "Coracle", Base: "https://coracle.social/relays/{code}", Platform: "web"}
@@ -66,7 +67,7 @@ func generateClientList(
case -1: // relays case -1: // relays
clients = []ClientReference{ clients = []ClientReference{
native, native,
coracleRelay, nostrrrRelay, nostterRelay, coracleRelay, nostrrrRelay,
} }
case 1, 6: case 1, 6:
clients = []ClientReference{ clients = []ClientReference{

View File

@@ -2,6 +2,7 @@ package main
import ( import (
"net/http" "net/http"
"net/url"
"strings" "strings"
"time" "time"
@@ -97,7 +98,12 @@ func renderRelayPage(w http.ResponseWriter, r *http.Request) {
Proxy: "https://" + hostname + "/njump/proxy?src=", Proxy: "https://" + hostname + "/njump/proxy?src=",
LastNotes: renderableLastNotes, LastNotes: renderableLastNotes,
ModifiedAt: lastEventAt.Format("2006-01-02T15:04:05Z07:00"), 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) }).Render(r.Context(), w)
} }
} }