Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 591 Bytes

File metadata and controls

24 lines (18 loc) · 591 Bytes

rx-messaging

Build Status

A lightweight tcp/tls messaging protocol implementation based on rxjs.

Example

import {RxServer, RxClient} from "rx-messaging";

let server = new RxServer()
server.channel("my-channel").messages$
  .subscribe(msg => {
    console.log(msg.data);
    server.close();
  });
server.listen(12345);

let client = new RxClient({port: 12345});
client.connect();
client.send("my-channel", {foo: "bar"});
  .then(() => client.disconnect());