fix NIP-01 top-level JSON array messages.

pull/36/head
fiatjaf 2021-10-04 01:28:16 -03:00
rodzic 9ee3a0259e
commit 69509f40cd
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -44,12 +44,13 @@ To obtain the `event.id`, we `sha256` the serialized event. The serialization is
### Communication between clients and relays
Relays expose a websocket endpoint at its domain under the `/ws` path (say, `ws(s)://relay.domain/ws`) to which clients can connect.
Relays expose a websocket endpoint to which clients can connect.
Clients can send either 3 types of messages, according to the following patterns:
* `EVENT <event JSON as defined above>`, used to publish events.
* `REQ <id> <filter JSON>...`, used to request events and subscribe to new updates.
* `CLOSE <id>`, used to stop previous subscriptions.
Clients can send either 3 types of messages, which must be JSON arrays, according to the following patterns:
* `["EVENT", <event JSON as defined above>`], used to publish events.
* `["REQ", <id>, <filter JSON>...`], used to request events and subscribe to new updates.
* `["CLOSE", <id>]`, used to stop previous subscriptions.
`<id>` is a random string that should be used to represent a subscription. The same