Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Client = function(url, protocols, options) {
options = options || {};
this.url = url;
this._uri = require('url').parse(url);
this._driver = driver.client(url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var secure = (this._uri.protocol === 'wss:'),
onConnect = function() { self._driver.start() },
tlsOptions = {},
self = this;
if (options.ca) tlsOptions.ca = options.ca;
var connection = secure
var Client = function(_url, protocols, options) {
options = options || {};
this.url = _url;
this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var proxy = options.proxy || {},
endpoint = url.parse(proxy.origin || this.url),
port = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
onConnect = function() { self._onConnect() },
originTLS = options.tls || {},
socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
self = this;
var Client = function(_url, protocols, options) {
options = options || {};
this.url = _url;
this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var proxy = options.proxy || {},
endpoint = url.parse(proxy.origin || this.url),
port = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
onConnect = function() { self._onConnect() },
originTLS = options.tls || {},
socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
self = this;
var Client = function(url, protocols, options) {
options = options || {};
this.url = url;
this._uri = require('url').parse(url);
this._driver = driver.client(url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var secure = (this._uri.protocol === 'wss:'),
onConnect = function() { self._driver.start() },
tlsOptions = {},
self = this;
if (options.ca) tlsOptions.ca = options.ca;
var connection = secure
var Client = function(_url, protocols, options) {
options = options || {};
this.url = _url;
this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var proxy = options.proxy || {},
endpoint = url.parse(proxy.origin || this.url),
port = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
onConnect = function() { self._onConnect() },
netOptions = options.net || {},
originTLS = options.tls || {},
socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
var Client = function(_url, protocols, options) {
options = options || {};
this.url = _url;
this._driver = driver.client(this.url, { maxLength: options.maxLength, protocols: protocols });
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var proxy = options.proxy || {},
endpoint = url.parse(proxy.origin || this.url),
port = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
onConnect = function() { self._onConnect() },
netOptions = options.net || {},
originTLS = options.tls || {},
socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
var Client = function(_url, protocols, options) {
options = options || {};
this.url = _url;
this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var proxy = options.proxy || {},
endpoint = url.parse(proxy.origin || this.url),
port = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
onConnect = function() { self._onConnect() },
originTLS = options.tls || {},
socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
self = this;
var Client = function(_url, protocols, options) {
options = options || {};
this.url = _url;
this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var proxy = options.proxy || {},
endpoint = url.parse(proxy.origin || this.url),
port = endpoint.port || DEFAULT_PORTS[endpoint.protocol],
secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0,
onConnect = function() { self._onConnect() },
originTLS = options.tls || {},
socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS,
self = this;
var Client = function(url, protocols, options) {
this.url = url;
this._uri = require('url').parse(url);
this._driver = driver.client(url, {protocols: protocols});
['open', 'error'].forEach(function(event) {
this._driver.on(event, function() {
self.headers = self._driver.headers;
self.statusCode = self._driver.statusCode;
});
}, this);
var secure = (this._uri.protocol === 'wss:'),
onConnect = function() { self._driver.start() },
tlsOptions = {},
self = this;
if (options && options.verify === false) tlsOptions.rejectUnauthorized = false;
var connection = secure