Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

engine.io-client

Package Overview
Dependencies
Maintainers
2
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine.io-client - npm Package Compare versions

Comparing version 1.7.2 to 1.8.0

12

History.md
1.8.0 / 2016-11-20
===================
* [fix] Fixed regression creating connection over https from node (#513)
* [fix] Fixed regression creating connection over wss from node (#514)
* [feature] Enable definition of timeouts for xhr-polling (#456)
* [feature] Added flag forceNode to override the normal behavior of prefering Browser based implementations. (#469)
* [feature] add localAddress option (#487)
* [chore] update dependencies (#516)
* [chore] Speed up lint by avoiding '**/*.js' matching pattern (#517)
* [chore] Bump debug to version 2.3.3 (#520)
1.7.2 / 2016-10-24

@@ -3,0 +15,0 @@ ===================

9

lib/socket.js

@@ -95,2 +95,3 @@ /**

this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;
this.forceNode = !!opts.forceNode;

@@ -103,2 +104,6 @@ // other options for Node.js client

}
if (opts.localAddress) {
this.localAddress = opts.localAddress;
}
}

@@ -189,3 +194,5 @@

perMessageDeflate: this.perMessageDeflate,
extraHeaders: this.extraHeaders
extraHeaders: this.extraHeaders,
forceNode: this.forceNode,
localAddress: this.localAddress
});

@@ -192,0 +199,0 @@

@@ -42,5 +42,7 @@ /**

this.rejectUnauthorized = opts.rejectUnauthorized;
this.forceNode = opts.forceNode;
// other options for Node.js client
this.extraHeaders = opts.extraHeaders;
this.localAddress = opts.localAddress;
}

@@ -47,0 +49,0 @@

@@ -33,2 +33,3 @@ /**

Polling.call(this, opts);
this.requestTimeout = opts.requestTimeout;

@@ -88,2 +89,3 @@ if (global.location) {

opts.rejectUnauthorized = this.rejectUnauthorized;
opts.requestTimeout = this.requestTimeout;

@@ -152,2 +154,3 @@ // other options for Node.js client

this.enablesXDR = opts.enablesXDR;
this.requestTimeout = opts.requestTimeout;

@@ -234,2 +237,6 @@ // SSL options for Node.js client

if (this.requestTimeout) {
xhr.timeout = this.requestTimeout;
}
if (this.hasXDR()) {

@@ -236,0 +243,0 @@ xhr.onload = function () {

4

lib/transports/polling.js

@@ -233,4 +233,4 @@ /**

// avoid port if default for schema
if (this.port && (('https' === schema && this.port !== 443) ||
('http' === schema && this.port !== 80))) {
if (this.port && (('https' === schema && Number(this.port) !== 443) ||
('http' === schema && Number(this.port) !== 80))) {
port = ':' + this.port;

@@ -237,0 +237,0 @@ }

@@ -12,2 +12,8 @@ /**

var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
var NodeWebSocket;
if (typeof window === 'undefined') {
try {
NodeWebSocket = require('ws');
} catch (e) { }
}

@@ -22,5 +28,3 @@ /**

if (!WebSocket && typeof window === 'undefined') {
try {
WebSocket = require('ws');
} catch (e) { }
WebSocket = NodeWebSocket;
}

@@ -47,2 +51,6 @@

this.perMessageDeflate = opts.perMessageDeflate;
this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
if (!this.usingBrowserWebSocket) {
WebSocket = NodeWebSocket;
}
Transport.call(this, opts);

@@ -101,5 +109,8 @@ }

}
if (this.localAddress) {
opts.localAddress = this.localAddress;
}
try {
this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
this.ws = this.usingBrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
} catch (err) {

@@ -163,3 +174,3 @@ return this.emit('error', err);

parser.encodePacket(packet, self.supportsBinary, function (data) {
if (!BrowserWebSocket) {
if (!self.usingBrowserWebSocket) {
// always create a new object (GH-437)

@@ -183,3 +194,3 @@ var opts = {};

try {
if (BrowserWebSocket) {
if (self.usingBrowserWebSocket) {
// TypeError is thrown when passing the second argument on Safari

@@ -245,4 +256,4 @@ self.ws.send(data);

// avoid port if default for schema
if (this.port && (('wss' === schema && this.port !== 443) ||
('ws' === schema && this.port !== 80))) {
if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
('ws' === schema && Number(this.port) !== 80))) {
port = ':' + this.port;

@@ -249,0 +260,0 @@ }

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "1.7.2",
"version": "1.8.0",
"homepage": "https://github.com/socketio/engine.io-client",

@@ -27,13 +27,13 @@ "contributors": [

"dependencies": {
"component-emitter": "1.1.2",
"component-emitter": "1.2.1",
"component-inherit": "0.0.3",
"debug": "2.2.0",
"debug": "2.3.3",
"engine.io-parser": "1.3.1",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"parsejson": "0.0.1",
"parseqs": "0.0.2",
"parseuri": "0.0.4",
"parsejson": "0.0.3",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
"ws": "1.1.1",
"xmlhttprequest-ssl": "1.5.1",
"xmlhttprequest-ssl": "1.5.3",
"yeast": "0.1.2"

@@ -52,3 +52,3 @@ },

"eslint-plugin-standard": "1.3.1",
"engine.io": "1.7.2",
"engine.io": "1.8.0",
"expect.js": "0.2.0",

@@ -55,0 +55,0 @@ "express": "3.4.8",

@@ -162,3 +162,3 @@

- `close`
- Fired upon disconnection. In compliance with the WebSocket API spec, this event may be
- Fired upon disconnection. In compliance with the WebSocket API spec, this event may be
fired even if the `open` event does not occur (i.e. due to connection error or `close()`).

@@ -228,2 +228,5 @@ - `error`

- `onlyBinaryUpgrades` (`Boolean`): whether transport upgrades should be restricted to transports supporting binary data (`false`)
- `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)
- `forceNode` (`Boolean`): Uses NodeJS implementation for websockets - even if there is a native Browser-Websocket available, which is preferred by default over the NodeJS implementation. (This is useful when using hybrid platforms like nw.js or electron) (`false`, NodeJS only)
- `localAddress` (`String`): the local IP address to connect to
- `send`

@@ -295,2 +298,1 @@ - Sends a message to the server

MIT - Copyright (c) 2014 Automattic, Inc.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc