mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
30 lines
396 B
JavaScript
30 lines
396 B
JavaScript
|
|
/**
|
|
* Module dependencies.
|
|
*/
|
|
|
|
var eio = require('..');
|
|
|
|
/**
|
|
* Listen shortcut that fires a callback on an epheemal port.
|
|
*/
|
|
|
|
exports.listen = function (opts, fn) {
|
|
if ('function' == typeof opts) {
|
|
fn = opts;
|
|
opts = {};
|
|
}
|
|
|
|
var e = eio.listen(null, opts, function () {
|
|
fn(e.httpServer.address().port);
|
|
});
|
|
|
|
return e;
|
|
};
|
|
|
|
/**
|
|
* Sprintf util.
|
|
*/
|
|
|
|
require('s').extend();
|