mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
add nostter as relay browser.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user