How to use the defaults.host function in defaults

To help you get started, we’ve selected a few defaults 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 pusher / pusher-js / src / core / config.ts View on Github external
export var getGlobalConfig = function() {
  return {
    wsHost: Defaults.host,
    wsPort: Defaults.ws_port,
    wssPort: Defaults.wss_port,
    httpHost: Defaults.sockjs_host,
    httpPort: Defaults.sockjs_http_port,
    httpsPort: Defaults.sockjs_https_port,
    httpPath: Defaults.sockjs_path,
    statsHost: Defaults.stats_host,
    authEndpoint: Defaults.channel_auth_endpoint,
    authTransport: Defaults.channel_auth_transport,
    // TODO make this consistent with other options in next major version
    activity_timeout: Defaults.activity_timeout,
    pong_timeout: Defaults.pong_timeout,
    unavailable_timeout: Defaults.unavailable_timeout
  };
};
github rapid7 / le_node / src / node_modules / logger.js View on Github external
set host(val) {
		if (!_.isString(val) || !val.length) {
			this[$host] = defaults.host;
			return;
		}

		val = val.replace(/^https?:\/\//, '');

		const url = urlUtil.parse(`http://${ val }`);

		this[$host] = url.hostname || defaults.host;

		if (url.port) this.port = url.port;
	}
github rapid7 / le_node / src / node_modules / logger.js View on Github external
set host(val) {
		if (!_.isString(val) || !val.length) {
			this[$host] = defaults.host;
			return;
		}

		val = val.replace(/^https?:\/\//, '');

		const url = urlUtil.parse(`http://${ val }`);

		this[$host] = url.hostname || defaults.host;

		if (url.port) this.port = url.port;
	}