khatru: optional ChallengePrefix.
This commit is contained in:
@@ -75,7 +75,7 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
|
||||
ws := &WebSocket{
|
||||
conn: conn,
|
||||
Request: r,
|
||||
Challenge: hex.EncodeToString(challenge),
|
||||
Challenge: rl.ChallengePrefix + hex.EncodeToString(challenge),
|
||||
negentropySessions: xsync.NewMapOf[string, *NegentropySession](),
|
||||
}
|
||||
ws.Context, ws.cancel = context.WithCancel(context.Background())
|
||||
|
||||
@@ -75,6 +75,9 @@ type Relay struct {
|
||||
OverwriteRelayInformation func(ctx context.Context, r *http.Request, info nip11.RelayInformationDocument) nip11.RelayInformationDocument
|
||||
PreventBroadcast func(ws *WebSocket, event nostr.Event) bool
|
||||
|
||||
// this can be ignored unless you know what you're doing
|
||||
ChallengePrefix string
|
||||
|
||||
// these are used when this relays acts as a router
|
||||
routes []Route
|
||||
getSubRelayFromEvent func(*nostr.Event) *Relay // used for handling EVENTs
|
||||
|
||||
Reference in New Issue
Block a user