diff --git a/khatru/handlers.go b/khatru/handlers.go index 6323279..0b349be 100644 --- a/khatru/handlers.go +++ b/khatru/handlers.go @@ -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()) diff --git a/khatru/relay.go b/khatru/relay.go index 925361a..74b53a6 100644 --- a/khatru/relay.go +++ b/khatru/relay.go @@ -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