This introduces a new notice-like event with more structure so that clients
can know if an event is sucessfully written to the database. Clients
can't really do much with the current NOTICE messages, but with these
structured result messages, it can know if an event was sucessfully
saved.
Whenever there is an error and we have an id available (event id, sub
id, etc) we return these structured OK events instead.
Example:
When saving the following event:
["EVENT",{"id": "event_id" }]
The server will now return events in the following format:
["OK", event_id, "true|false", message]
For example, on a successful save:
["OK", "event_id", "true"]
If we already have the event:
["OK", "event_id", "true", "duplicate"]
If the event is rejected:
["OK", "event_id", "false", "you are blocked"]
If a subscription fails:
["OK", "sub_id", "false", "Too many subscriptions"]
NIP coming soon!
Add a ping interval setting that allows you to customize the websocket
ping interval. The default of 5 minutes may be too high for some proxy
servers that disconnect connections that are held open for too long.
This enables support for using the proxied IP from cloudflare. The damus
relay is behind cloudflare, so to get accurate remote ip logging we need
to look at the headers instead of the socket address.
Signed-off-by: William Casarin <jb55@jb55.com>
These are pretty spammy on busy relays. I've been using the info log to
monitor spam attacks, and these are the least useful info log.
Leave the "stopping connection" log because it at least provides useful
sent/received information.
Signed-off-by: William Casarin <jb55@jb55.com>