- Register
- Login
- GetList
- Handshake
- Message
- Feed
- StatusOnline
- HandshakeKey
- HandshakeNotice
- FileAdd
- StorageFile
- GetFile
{
"type": "register",
"login": "your_login",
"password": "your_password"
}
if a request is valid, then a server answer:
{
"status": "ok"
}
if a request is invalid, then a server answer:
{
"status": "false"
}
{
"type": "login",
"login": "your_login",
"password": "your_password"
}
if a request is valid, then a server answer:
{
"status": "ok"
}
if a request is invalid, then a server answer:
{
"status": "false"
}
{
"type": "get_list"
}
the server should send this of each user.
{
"type": "status_online",
"status", 1,
"name", "laptop"
}
{
"type": "handshake",
"to_name": "laptop",
"status": 1,
"key": "fiopajsefoije0a89fy89yae89fya89sf98asef"
}
if a person is unavailable, then is return this:
{
"type": "handshake_answer",
"status_handshake": 0,
"to_name": "laptop"
}
if a person accepting the request, then the view is this:
{
"type": "handshake_answer",
"status_handshake": 1,
"to_name": "laptop"
}
{
"type": "message",
"to": "laptop",
"data": "f8ays8e9fy9a8yh39rh98ahf9ahefhasefasefjj"
}
then "laptop" accepts this message:
{
"type": "message",
"from": "nemesis",
"data": "f8ays8e9fy9a8yh39rh98ahf9ahefhasefasefjj"
}
{
"type": "feed"
}
if the server is store messages then the answer is this:
{
"type": "message",
"from": "nemesis",
"to": "laptop",
"data": "fjaejf89asefa89seyf89asyef98ayhsef"
}
a server also can send this data:
{
"type": "status_online",
"status", 1,
"name", "laptop"
}
{
"type": "handshake_key",
"from": "nemesis",
"key": "fafasjfsa9fasf98sfyha9s8hf98ashf98hasf"
}
{
"type": "handshake_notice",
"from": "laptop",
"status": 1
}
you should send this. if is_start is 0 then inserting a new file to the database. if is_start is 1 then concating new data. size of JSON packet, not more than 4096 bytes. I recommend a DATA field filling 16 * 80 bytes. CKEY and IVEC are RSA encrypted.
{
"type": "file_add",
"to": "laptop",
"filename: "test.txt",
"ckey": "fa0e0fjeaef...",
"ivec": "fase9fjasef9aef...",
"data": "fajse90fjaefafeahefahef",
"is_start": 0
}
you should send this data.
{
"type": "storage_files",
"from": "laptop"
}
the answer will be it.
{
"type": "storage_files",
"from": "pcpc",
"filename": "test.png",
"ckey": "fa9fe09asefsjef...",
"ivec": "faefj0a9ejfae..."
}
send this.
{
"type": "get_file",
"from": "laptop",
"filename": "test.png"
}
the answer will be it.
{
"type": "getting_file",
"from": "laptop",
"filename": "test.png",
"ckey": "faioefasfjeiaef0...",
"ivec": "faiojasefajsefj...",
"data": "aiofjaiojsefjioasoie",
"pos": 0,
"size": 13720
}