stupid simple engine.io stream + static server
npm install skateboardQuickly create a stream from the browser to the server with engine.io
npm install skateboard
``javascript
// server.js
var skateboard = require('skateboard');
skateboard({
dir: __dirname + '/public', // default (optional)
port : 8080, // default (optional)
transports: ['polling', 'websocket'] // default (optional)
// requestHandler: function(req, res) {} -- fallback request handler
}, function(stream) {
var start = Date.now();
stream.write('ping');
stream.on('data', function() {
console.log('latency:', (Date.now() - start) + 'ms');
});
});
`
skateboard([wshref [, fn]])
* wshref - optional cross domain skateboard to connect tofn
* - optional connection handler. first argument is a duplex stream
`html
`
* connection - emitted on the first connectiondisconnection
* - emitted whenever the connection disconnectsreconnection` - emitted whenever a new connection is established
*
MIT