How to use the faye-websocket.validateOptions function in faye-websocket

To help you get started, we’ve selected a few faye-websocket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gitterHQ / halley / javascript / adapters / node_adapter.js View on Github external
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);

faye-websocket

Standards-compliant WebSocket server and client

Apache-2.0
Latest version published 4 years ago

Package Health Score

73 / 100
Full package analysis