mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-26 10:15:52 -05:00
make room id optional depending on use
This commit is contained in:
parent
7328922aad
commit
16d577fdf5
22
100.md
22
100.md
|
@ -1,10 +1,16 @@
|
||||||
# NIP-100 WebRTC
|
NIP-100 WebRTC
|
||||||
|
==============
|
||||||
`draft` `optional` `author:jacany`
|
`draft` `optional` `author:jacany`
|
||||||
|
|
||||||
This NIP defines how to do WebRTC communication over nostr.
|
This NIP defines how to do WebRTC communication over nostr.
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
## Defining Rooms
|
## Defining Rooms
|
||||||
Rooms are essentially the space that you will be connected to. This must be defined by a `r` tag following the pubkey of the person you are connected to or some other identifier (maybe a lobby id for a joinable voice channel, etc.)
|
Rooms are essentially the space that you will be connected to. How rooms are defined depends.
|
||||||
|
1. Is this a one-on-one call? In that case just use the `p` tag.
|
||||||
|
2. If it is a group call (multiple people), then you will need both the `p` tag for communicating who the event is for, and the `r` tag for defining the room id.
|
||||||
|
|
||||||
|
In that case, when you are sending `connect` or `disconnect`, the usage of the `p` and `r` tag varies on your requirements
|
||||||
|
|
||||||
## Peers
|
## Peers
|
||||||
Who the client connects to can be chosen by the client. Ex: you can connect to everyone peer-to-peer or a WebRTC media server that is listening on nostr relays.
|
Who the client connects to can be chosen by the client. Ex: you can connect to everyone peer-to-peer or a WebRTC media server that is listening on nostr relays.
|
||||||
|
@ -24,7 +30,7 @@ The connection ID is inferred from the provided pubkey.
|
||||||
"pubkey": "<sender pubkey>",
|
"pubkey": "<sender pubkey>",
|
||||||
"tags": [
|
"tags": [
|
||||||
["type", "connect"],
|
["type", "connect"],
|
||||||
["r", "<plaintext room id>"]
|
...roominfo
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -37,7 +43,7 @@ This is used when disconnecting from everybody else. Ex: when browser tab is clo
|
||||||
"pubkey": "<sender pubkey>",
|
"pubkey": "<sender pubkey>",
|
||||||
"tags": [
|
"tags": [
|
||||||
["type", "disconnect"],
|
["type", "disconnect"],
|
||||||
["r", "<plaintext room id>"]
|
...roominfo
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -51,7 +57,7 @@ Used when responding to a `type:connect`. Offering to connect to that peer.
|
||||||
"tags": [
|
"tags": [
|
||||||
["type", "offer"],
|
["type", "offer"],
|
||||||
["p", "<reciever>"],
|
["p", "<reciever>"],
|
||||||
["r", "<encrypted room id>"]
|
["r", "<optional encrypted room id>"]
|
||||||
],
|
],
|
||||||
"content": {
|
"content": {
|
||||||
"offer": "<offer>",
|
"offer": "<offer>",
|
||||||
|
@ -68,7 +74,7 @@ Used when responding to a `type:connect`. Offering to connect to that peer.
|
||||||
"tags": [
|
"tags": [
|
||||||
["type", "answer"],
|
["type", "answer"],
|
||||||
["p", "<reciever>"],
|
["p", "<reciever>"],
|
||||||
["r", "<encrypted room id>"]
|
["r", "<optional encrypted room id>"]
|
||||||
],
|
],
|
||||||
"content": {
|
"content": {
|
||||||
"sdp": "<sdp>",
|
"sdp": "<sdp>",
|
||||||
|
@ -85,11 +91,11 @@ Used when responding to a `type:connect`. Offering to connect to that peer.
|
||||||
"tags": [
|
"tags": [
|
||||||
["type", "candidate"],
|
["type", "candidate"],
|
||||||
["p", "<reciever>"],
|
["p", "<reciever>"],
|
||||||
["r", "<encrypted room id>"]
|
["r", "<optional encrypted room id>"]
|
||||||
],
|
],
|
||||||
"content": {
|
"content": {
|
||||||
"candidate": "<sdp>",
|
"candidate": "<sdp>",
|
||||||
<misc>
|
...misc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user