Git Product home page Git Product logo

nem-server's Introduction

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
}

nem-server's People

Contributors

xverizex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

benadis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.