Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
UiManager.prototype._setupSocketServer = function () {
this._socketServer = new PrimusIo(this._httpServer, {
port: this._config.get('ui.UiManager.socketServer.port'),
transformer: this._config.get('ui.UiManager.socketServer.transformer'),
parser: this._config.get('ui.UiManager.socketServer.parser')
});
var staticPublicPath = this._config.get('ui.UiManager.staticServer.publicPath');
var clientLibPath = path.resolve(path.join(staticPublicPath, 'primus.io.js'));
// todo check if file exists
this._socketServer.save(clientLibPath);
this._setupSocketChannelComponentMap();
this._setupSocketChannels();
};
setup_io: function(app, server) {
// Setup Socket.IO
var io;
var transformer = config.primus_transformer || "engine.io";
var primus = new Primus(server, {
transformer: transformer,
});
// add rooms to Primus
_primus = primus;
this.install(primus);
var shutdown = require_core('server/shutdown');
shutdown.install(primus);
/**
* auth callback
*
* @event auth
* @param {app} app the express app to add query parsing middleware to
*/
private _setupSocketServer ():void {
this._socketServer = new PrimusIo(this._httpServer, {
port : this._config.get('ui.UiManager.socketServer.port'),
transformer: this._config.get('ui.UiManager.socketServer.transformer'),
parser : this._config.get('ui.UiManager.socketServer.parser')
});
var staticPublicPath:string = this._config.get('ui.UiManager.staticServer.publicPath');
var clientLibPath:string = path.resolve(path.join(staticPublicPath, 'primus.io.js'));
// todo check if file exists
this._socketServer.save(clientLibPath);
this._setupSocketChannelComponentMap();
this._setupSocketChannels();
}