Skip to content

xverizex/nem-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nem server api

  1. Register
  2. Login
  3. GetList
  4. Handshake
  5. Message
  6. Feed
  7. StatusOnline
  8. HandshakeKey
  9. HandshakeNotice
  10. FileAdd
  11. StorageFile
  12. GetFile

Register

{
	"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"
}

Login

{
	"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"
}

GetList

{
	"type": "get_list"
}

the server should send this of each user.

{
	"type": "status_online",
	"status", 1,
	"name", "laptop"
}

Handshake

{
	"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"
}

Message

{
	"type": "message",
	"to": "laptop",
	"data": "f8ays8e9fy9a8yh39rh98ahf9ahefhasefasefjj"
}

then "laptop" accepts this message:

{
	"type": "message",
	"from": "nemesis",
	"data": "f8ays8e9fy9a8yh39rh98ahf9ahefhasefasefjj"
}

Feed

{
	"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:

StatusOnline

{
	"type": "status_online",
	"status", 1,
	"name", "laptop"
}

HandshakeKey

{
	"type": "handshake_key",
	"from": "nemesis",
	"key": "fafasjfsa9fasf98sfyha9s8hf98ashf98hasf"
}

HandshakeNotice

{
	"type": "handshake_notice",
	"from": "laptop",
	"status": 1
}

FileAdd

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
}

StorageFile

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..."
}

GetFile

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
}

About

server secure chat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages