EventRepository to use
Options for NostrRelay
Broadcast an event. This method does not call any plugins.
The event to broadcast
Handle a new client connection. This method should be called when a new client connects to the Nostr Relay server.
Client instance, usually a WebSocket
Optional
ip: stringIP address of the client
Handle a client disconnection. This method should be called when a client disconnects from the Nostr Relay server.
Client instance, usually a WebSocket
Handle an event.
The event to handle
Handle an incoming message from a client. It can be an EVENT, REQ, CLOSE,
or AUTH message. Before calling this method, you should validate the
message by @nostr-relay/validator
or other validators.
Client instance, usually a WebSocket
Incoming message from the client
Check whether a client is authorized. If NIP-42 is unable, this method always returns true.
Client instance, usually a WebSocket
Register a plugin.
Plugin to register
Create a new NostrRelay instance.