mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-28 11:15:50 -05:00
Initial Draft
This commit is contained in:
parent
a886b43b48
commit
aadc197e88
80
100.md
Normal file
80
100.md
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
# NIP-100
|
||||||
|
## WebRTC
|
||||||
|
`draft` `optional` `author:jacany`
|
||||||
|
|
||||||
|
This NIP defines how to do WebRTC communication over nostr
|
||||||
|
|
||||||
|
### Broadcasting that you are present
|
||||||
|
Announces that you are here, and ready to connect to others.
|
||||||
|
The connection ID is inferred from the provided pubkey.
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 25050,
|
||||||
|
"pubkey": "<sender pubkey>",
|
||||||
|
"tags": [
|
||||||
|
["type", "connect"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Closing
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 25050,
|
||||||
|
"pubkey": "<sender pubkey>",
|
||||||
|
"tags": [
|
||||||
|
["type", "disconnect"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Offering to connect
|
||||||
|
Used when responding to a `type:connect`. Offering to connect to that peer.
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 25050,
|
||||||
|
"pubkey": "<sender pubkey>",
|
||||||
|
"tags": [
|
||||||
|
["type", "offer"],
|
||||||
|
["p", "<reciever pubkey>"]
|
||||||
|
],
|
||||||
|
"content": {
|
||||||
|
"offer": "<offer>",
|
||||||
|
"type": "offer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Answering an Offer
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 25050,
|
||||||
|
"pubkey": "<sender pubkey>",
|
||||||
|
"tags": [
|
||||||
|
["type", "answer"],
|
||||||
|
["p", "<reciever pubkey>"]
|
||||||
|
],
|
||||||
|
"content": {
|
||||||
|
"sdp": "<sdp>",
|
||||||
|
"type": "answer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Broadcasting ICE Candidate
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"kind": 25050,
|
||||||
|
"pubkey": "<sender pubkey>",
|
||||||
|
"tags": [
|
||||||
|
["type", "answer"],
|
||||||
|
["p", "<reciever pubkey>"]
|
||||||
|
],
|
||||||
|
"content": {
|
||||||
|
"candidate": "<sdp>",
|
||||||
|
<misc>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Essentially, just directly feed what comes out of the WebRTC functions straight into the `content` field. It makes things cleaner and easier.
|
Loading…
Reference in New Issue
Block a user