-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential new hooks #23
Comments
Could make a type RateLimiter interface {
AcceptMessage(ws *WebSocket, message []byte) error
BeforeSendEvent(ws *WebSocket, event nostr.Event) error
} There are fairly natural places to place these hooks in handlers.go. Alternatively to |
Although on second thought, |
IP is easy to spoof, I can see someone flooding data from different IPs. Also banning one IP could potentially prevent honest users to send traffic. I think it's better to use the existing |
What prevents users from just spamming with newly generated pubkeys? That's far easier than sophisticated IP switching methods using different NATs or IP pools. Since we're not talking about UDP, traffic still has to be route back to complete a connection in the first place. They still have to be real routable IPs. pubkeys are effectively infinite in comparison. I'm super early looking at the relayer code but on the surface this doesn't seem a bad idea and I could see possibly making use of it myself. |
Not really an issue, just a writeup on which data might come in handy for various custom implementations:
AcceptEvent
. Why have this information? Some people believing banning IPs or rate-limiting them is better than adding PoW cost or LN invoices. If you want to rate-limit users, you probably want to do it through the connection identifier.Both of these could also be used to send metrics to observe the system in live conditions i.e. how many different connections do we have, average number of events per connection, how many events we send to subscriptions on average, what are the outliers etc.
The text was updated successfully, but these errors were encountered: