You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
815 B

/*!
* ws: a node.js websocket client
* Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
* MIT Licensed
*/
module.exports = require('./lib/WebSocket');
module.exports.Server = require('./lib/WebSocketServer');
module.exports.Sender = require('./lib/Sender');
module.exports.Receiver = require('./lib/Receiver');
module.exports.createServer = function (options, connectionListener) {
var server = new module.exports.Server(options);
if (typeof connectionListener === 'function') {
server.on('connection', connectionListener);
}
return server;
};
module.exports.connect = module.exports.createConnection = function (address, openListener) {
var client = new module.exports(address);
if (typeof openListener === 'function') {
client.on('open', openListener);
}
return client;
};