yar-node
✨ Features:
- client[√]
- server[√]
- packager: json[√]、php[√]、msgpack[×]
- protocol: http[√]、tcp[×]、unix[×]
Server
const YarServer = ; {} const server = ; server;
Client
const YarClient = ; const client = 'http://host/api/'; client;
Yar Header
typedef struct _yar_header { unsigned int id; // transaction id unsigned short version; // protocl version unsigned int magic_num; // default is: 0x80DFEC60 unsigned int reserved; unsigned char provider[32]; // reqeust from who unsigned char token[32]; // request token, used for authentication unsigned int body_len; // request body len}
Request
i: '' // transaction id m: '' // the method which being called p: {} // parameters
Response
i: '' // transaction id s: '' // status r: '' // return value o: '' // output e: '' // error or exception