69 lines
752 B
Markdown
69 lines
752 B
Markdown
|
# vybe websocket protocol - sent by client
|
||
|
|
||
|
socket.io actions + expected msg format and other info
|
||
|
|
||
|
all responses have same type as original message
|
||
|
|
||
|
if a message fails, you get a response with the following format:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"success": false,
|
||
|
"message": "Something broke"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## create_user
|
||
|
|
||
|
Message format:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"name": "unique_username",
|
||
|
"pubkey": "your PGP public key"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Response format:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"success": true,
|
||
|
"id": 123
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## get_history
|
||
|
|
||
|
todo
|
||
|
|
||
|
## send_message
|
||
|
|
||
|
Message format:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"name": "unique_username",
|
||
|
"message": "signed message"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
Response format:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"success": true
|
||
|
}
|
||
|
```
|
||
|
|
||
|
# sent by server
|
||
|
|
||
|
## new_message
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"name": "unique_username",
|
||
|
"message": "msg text"
|
||
|
}
|
||
|
```
|