1.0.2 • Published 7 years ago

@lug/e-pigeon v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

logo e-pigeon

Implementation of an handmade application protocol for messaging

Be careful this is an alpha version of the software and many bugs can be found in it. If you use it and found some, please create an issue, it can be helpful.

What does it do ?

That's a simple messaging server / client using node-ipc in the hood\ It garantee the order of sended messages and that the message has been received.\ You can send a message to a group of clients.\ Server cannot receive message, but you can start a client in the same app of the server and will use localhost to communicate.

Getting started

Works on node 8+\ Install it with npm i @lug/e-pigeon

You can check example for an simple use of this module.

Server

const { EPigeonServer } = require('@lug/e-pigeon')
const server = new EPigeonServer()
server.serve(9999)

Client

const { EPigeonClient } = require('@lug/e-pigeon')
const client = new EPigeonClient()
client.connect('host', 9999)

Documentation

For debugging, you can set the env debug variable to epigeon:* like described in the debug module

Server

Methods

nameparamsdescription
serveport:Intserve on this port
stop-stop the server

Client

Methods

nameparamsdescription
connecthost:string / port:Intconnect to server
disconnect-disconnect from server
updateSession{key:value,...}set values to your client session
sendMessageto: uuid or {key:value} / content:anysend a message to a uuid or to all client that match the key:value on their session

Events

You can add en event handler with client.on(<event>, <callback>)

eventcallback paramsdescription
connected-when the client is connected to the server
disconnected-when the client is disconnected
authenticated-when the client is authenticated
session.update{uuid, session}when a client update his session
messagemessagewhen a message is recieved, contains many things but the content is stored in message.payload
client.connectuuidwhen a client connect to the server
client.disconnectuuidwhen a client disconnect from the server
1.0.2

7 years ago

1.0.1

7 years ago

1.0.1-beta.8

7 years ago

1.0.1-beta.7

7 years ago

1.0.1-beta.6

7 years ago

1.0.1-beta.5

7 years ago

1.0.1-beta.4

7 years ago

1.0.1-beta.3

7 years ago

1.0.1-beta.2

7 years ago

1.0.1-beta.1

7 years ago

1.0.0

7 years ago

0.0.1-alpha.1

7 years ago