khatru: add and remove listener hooks.

This commit is contained in:
fiatjaf
2026-04-29 19:32:47 -03:00
parent 744fb0702c
commit 05b426e67e
2 changed files with 19 additions and 2 deletions
+2
View File
@@ -84,6 +84,8 @@ type Relay struct {
RejectConnection func(r *http.Request) bool
OnConnect func(ctx context.Context)
OnDisconnect func(ctx context.Context)
OnListenerAdded func(ws *WebSocket, ssid int, id string, filter nostr.Filter)
OnListenerRemoved func(ws *WebSocket, ssid int, id string, filter nostr.Filter)
OverwriteRelayInformation func(ctx context.Context, r *http.Request, info nip11.RelayInformationDocument) nip11.RelayInformationDocument
PreventBroadcast func(ws *WebSocket, filter nostr.Filter, event nostr.Event) bool