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

@@ -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)
}
}