NIP-200: mention about CORS policy

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-01-05 22:31:00 +07:00
parent 3e201f5352
commit c6033f7eda

6
200.md
View File

@ -10,11 +10,13 @@ This NIP describes the basic of communicating to relays over HTTP(S) requests.
## Communication between clients and relays ## Communication between clients and relays
Relays may expose NoH endpoints that client could reach. Client may make HTTP requests to each relays endpoint for specified tasks as specified in `noh` field at `/.well-known/nostr.json`. Relays MAY limit number of requests from specific IP/Client/etc. Relays may expose NoH endpoints that client could reach. Client may make HTTP requests to each relays endpoint for specified tasks as specified in NIP-11. Relays MAY limit number of requests from specific IP/Client/etc.
Relays must ensure that the NoH endpoints **MUST** be served with `Access-Control-Allow-Origin: *` header to ensure it can be validated by pure JS apps running in modern browsers.
### From client to relay: getting events and sending event ### From client to relay: getting events and sending event
In `noh` field at `/.well-known/nostr.json`, Client could make a request to `req` or `publish` endpoint. Client could make a request to `req` or `publish` endpoint that were specified in `/.well-known/nostr.json`
When fetching events, Client can optionally specify filters directly into the URI search query: When fetching events, Client can optionally specify filters directly into the URI search query:
- `<req>?<filter>` - `<req>?<filter>`