Skip to content

azer/simple.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple.io

Minimalistic wrapper around engine.io* that you can browserify.

Install

$ npm install simple.io

Usage

Server-side:

server = require('http').createServer().listen(3000)
onConnect = require('simple.io')(server)

onConnect(function(io){
  io.sub(function(msg){
    msg.from
    // => 'william'

    msg.text
    // => 'Morning, Paul'
  })

  io.pub({ from: 'paul', text: 'Oh, morning, William, how are you?' })
})

Client-side:

io = require('simple.io')() // or: require('simple.io')('localhost:1234')

io.pub({ from: 'william', text: 'Morning, Paul.' })

io.sub(function(msg){

  msg.from
  // => 'paul'

  msg.text
  // => 'Oh, morning, William, how are you?'

})

Testing

$ npm install -g indev
$ indev test

About

Minimalistic wrapper around engine.io and engine.io-client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published