poly-socketio

1.1.5 • Public • Published

poly-socketio npm version CircleCI Code Climate Test Coverage

Polyglot SocketIO server that allows cross-language communication via JSON

Installation

npm i --save poly-socketio

Usage

This is used in AIVA to communicate JSON data among the Nodejs, Python and Ruby runtimes.

const polyIO = require('poly-socketio')
const IOPORT = 6466
var ioPromise = polyIO.server({port: IOPORT, clientCount: 1, timeoutMs: 15000, debug: false})
polyIO.client({port: IOPORT}) // this exposes a global.client
 
var msg = {
  input: 'hello js',
  to: 'echo.js',
  intent: 'ping'
}
global.client.pass(msg)
  .then((reply) => {
    if (reply.output === 'ping hello js') {
      console.log('success!')
    } else {
      console.log('error')
    }
  })

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.5
    93
    • latest

Version History

Package Sidebar

Install

npm i poly-socketio

Weekly Downloads

93

Version

1.1.5

License

MIT

Last publish

Collaborators

  • kengz