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