Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initialize: function(options) {
this._options = options || {};
Faye_WebSocket.validateOptions(this._options, ['engine', 'mount', 'ping', 'timeout', 'extensions', 'websocketExtensions']);
this._extensions = [];
this._endpoint = this._options.mount || this.DEFAULT_ENDPOINT;
this._endpointRe = new RegExp('^' + this._endpoint.replace(/\/$/, '') + '(/[^/]*)*(\\.[^\\.]+)?$');
this._server = new Faye_Server(this._options);
this._static = new Faye_StaticServer(path.dirname(__filename) + '/../browser', /\.(?:js|map)$/);
this._static.map(path.basename(this._endpoint) + '.js', this.SCRIPT_PATH);
this._static.map('client.js', this.SCRIPT_PATH);
var extensions = this._options.extensions,
websocketExtensions = this._options.websocketExtensions,
i, n;
if (extensions) {
extensions = [].concat(extensions);