cameri / nostream

A Nostr Relay written in TypeScript
MIT License
749 stars 195 forks source link

Interception of published events for processing #116

Open Semisol opened 1 year ago

Semisol commented 1 year ago

Is your feature request related to a problem? Please describe. I think that interception of all incoming events would be useful for:

Describe the solution you'd like There should be a way for any app to connect to the relay (gRPC, WS, doesn't matter, and could probably have authentication) and hook into all events being sent with the following information included:

and the connected client could answer with one of the following:

in the future, AUTH could be required. there should be a configuration option to block all event publishing if there is no connected client that is intercepting the events. (such as for a dynamic whitelist, I wouldn't want to allow non-whitelisted people from posting because the script I wrote went down)

Describe alternatives you've considered None

Additional context In the future, this could be extended to more things.

lylepratt commented 1 year ago

Just came here to explore if this was possible with nostream. We would implement this on Vida, if it were a thing, to make a paid relay. Happy to help!