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

engine.io-client

Package Overview
Dependencies
Maintainers
1
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 0.8.0 to 0.8.1

59

engine.io.js

@@ -143,5 +143,2 @@ !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.eio=e():"undefined"!=typeof global?global.eio=e():"undefined"!=typeof self&&(self.eio=e())}(function(){var define,module,exports;

this.open();
Socket.sockets.push(this);
Socket.sockets.evs.emit('add', this);
}

@@ -164,9 +161,2 @@

/**
* Static EventEmitter.
*/
Socket.sockets = [];
Socket.sockets.evs = new Emitter;
/**
* Expose deps for legacy compatibility

@@ -1074,7 +1064,7 @@ * and standalone browser access.

var XHR = require('./polling-xhr')
var XMLHttpRequest = require('xmlhttprequest')
, XHR = require('./polling-xhr')
, JSONP = require('./polling-jsonp')
, websocket = require('./websocket')
, flashsocket = require('./flashsocket')
, util = require('../util');

@@ -1118,3 +1108,4 @@ /**

xhr = util.request(xd, opts);
opts.xdomain = xd;
xhr = new XMLHttpRequest(opts);

@@ -1128,3 +1119,3 @@ if (xhr && !opts.forceJSONP) {

},{"../util":12,"./flashsocket":6,"./polling-jsonp":8,"./polling-xhr":9,"./websocket":11,"global":19}],8:[function(require,module,exports){
},{"./flashsocket":6,"./polling-jsonp":8,"./polling-xhr":9,"./websocket":11,"global":19,"xmlhttprequest":13}],8:[function(require,module,exports){

@@ -1368,3 +1359,4 @@ /**

var Polling = require('./polling')
var XMLHttpRequest = require('xmlhttprequest')
, Polling = require('./polling')
, util = require('../util')

@@ -1524,3 +1516,3 @@ , Emitter = require('../emitter')

Request.prototype.create = function(){
var xhr = this.xhr = util.request(this.xd, { agent: this.agent });
var xhr = this.xhr = new XMLHttpRequest({ agent: this.agent, xdomain: this.xd });
var self = this;

@@ -1660,3 +1652,3 @@

},{"../emitter":2,"../util":12,"./polling":10,"debug":14,"global":19}],10:[function(require,module,exports){
},{"../emitter":2,"../util":12,"./polling":10,"debug":14,"global":19,"xmlhttprequest":13}],10:[function(require,module,exports){
/**

@@ -2278,33 +2270,2 @@ * Module dependencies.

/**
* XHR request helper.
*
* @param {Boolean} whether we need xdomain
* @param {Object} opts Optional "options" object
* @api private
*/
exports.request = function request (xdomain, opts) {
opts = opts || {};
opts.xdomain = xdomain;
try {
var _XMLHttpRequest = require('xmlhttprequest');
return new _XMLHttpRequest(opts);
} catch (e) {}
// XMLHttpRequest can be disabled on IE
try {
if ('undefined' != typeof XMLHttpRequest && (!xdomain || exports.ua.hasCORS)) {
return new XMLHttpRequest();
}
} catch (e) { }
if (!xdomain) {
try {
return new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) { }
}
};
/**
* Parses an URI

@@ -2372,3 +2333,3 @@ *

},{"global":19,"has-cors":20,"xmlhttprequest":13}],13:[function(require,module,exports){
},{"global":19,"has-cors":20}],13:[function(require,module,exports){
// browser shim for xmlhttprequest module

@@ -2375,0 +2336,0 @@ var hasCORS = require('has-cors');

10

History.md
0.8.1 / 2014-01-17
==================
* package: bump debug to fix `localStorage` issue (fixes #213)
* remove duplicate xmlhttprequest code
* add iphone automated testing
* bump zuul to 1.3.0 to improve tests performance
* use invalid ip address for incorrect connection test
* Fix GH-224, remove sockets array
0.8.0 / 2014-01-05

@@ -3,0 +13,0 @@ ==================

@@ -87,5 +87,2 @@ /**

this.open();
Socket.sockets.push(this);
Socket.sockets.evs.emit('add', this);
}

@@ -108,9 +105,2 @@

/**
* Static EventEmitter.
*/
Socket.sockets = [];
Socket.sockets.evs = new Emitter;
/**
* Expose deps for legacy compatibility

@@ -117,0 +107,0 @@ * and standalone browser access.

@@ -6,7 +6,7 @@

var XHR = require('./polling-xhr')
var XMLHttpRequest = require('xmlhttprequest')
, XHR = require('./polling-xhr')
, JSONP = require('./polling-jsonp')
, websocket = require('./websocket')
, flashsocket = require('./flashsocket')
, util = require('../util');

@@ -50,3 +50,4 @@ /**

xhr = util.request(xd, opts);
opts.xdomain = xd;
xhr = new XMLHttpRequest(opts);

@@ -53,0 +54,0 @@ if (xhr && !opts.forceJSONP) {

@@ -5,3 +5,4 @@ /**

var Polling = require('./polling')
var XMLHttpRequest = require('xmlhttprequest')
, Polling = require('./polling')
, util = require('../util')

@@ -161,3 +162,3 @@ , Emitter = require('../emitter')

Request.prototype.create = function(){
var xhr = this.xhr = util.request(this.xd, { agent: this.agent });
var xhr = this.xhr = new XMLHttpRequest({ agent: this.agent, xdomain: this.xd });
var self = this;

@@ -164,0 +165,0 @@

@@ -185,33 +185,2 @@

/**
* XHR request helper.
*
* @param {Boolean} whether we need xdomain
* @param {Object} opts Optional "options" object
* @api private
*/
exports.request = function request (xdomain, opts) {
opts = opts || {};
opts.xdomain = xdomain;
try {
var _XMLHttpRequest = require('xmlhttprequest');
return new _XMLHttpRequest(opts);
} catch (e) {}
// XMLHttpRequest can be disabled on IE
try {
if ('undefined' != typeof XMLHttpRequest && (!xdomain || exports.ua.hasCORS)) {
return new XMLHttpRequest();
}
} catch (e) { }
if (!xdomain) {
try {
return new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) { }
}
};
/**
* Parses an URI

@@ -218,0 +187,0 @@ *

{
"name": "engine.io-client",
"description": "Client for the realtime Engine",
"version": "0.8.0",
"version": "0.8.1",
"homepage": "http://socket.io",

@@ -18,2 +18,6 @@ "contributors": [

"web": "https://github.com/cadorn"
},
{
"name": "Mark Mokryn",
"email": "mokesmokes@gmail.com"
}

@@ -29,6 +33,6 @@ ],

"engine.io-parser": "0.3.0",
"debug": "0.7.2"
"debug": "0.7.4"
},
"devDependencies": {
"zuul": "1.1.0",
"zuul": "1.3.0",
"mocha": "1.16.2",

@@ -38,3 +42,3 @@ "expect.js": "0.2.0",

"browserify": "2.35.1",
"engine.io": "0.8.0"
"engine.io": "0.8.1"
},

@@ -41,0 +45,0 @@ "scripts": {

@@ -12,22 +12,38 @@ # Engine.IO client

### With component
### With browserify
Engine.IO is a [component](http://github.com/component/component), which
means you can include it by using `require` on the browser:
Engine.IO is a commonjs module, which means you can include it by using
`require` on the browser and package using [browserify](http://browserify.org/):
1. install the client package
``` shell
npm install engine.io-client
```
1. write your app code
```js
var socket = require('engine.io')('ws://localhost');
var socket = require('engine.io-client')('ws://localhost');
socket.onopen = function(){
socket.onmessage = function(data){};
socket.onclose = function(){};
socket.onmessage = function(data){};
socket.onclose = function(){};
};
```
1. build your app bundle
```
browserify app.js > bundle.js
```
1. include on your page
```html
<script src="/path/to/bundle.js"></script>
```
### Standalone
If you decide not to use component you can find a `engine.io.js` file in
If you decide not to use browserify (or similar tool) you can find an `engine.io.js` file in
this repository, which is a standalone build you can use as follows:
```html
<script src="/path/to/build.js"></script>
<script src="/path/to/engine.io.js"></script>
<script>

@@ -60,6 +76,3 @@ // eio = Socket

- Isomorphic with WebSocket API
- Written for node, runs on browser thanks to
[browserbuild](http://github.com/learnboost/browserbuild)
- Maximizes code readability / maintenance.
- Simplifies testing.
- Runs on browser and node.js seamlessly
- Transports are independent of `Engine`

@@ -72,4 +85,2 @@ - Easy to debug

<hr><br>
### Socket

@@ -170,4 +181,12 @@

Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can
run the tests locally using the following command.
```
./node_modules/.bin/zuul --local 8080 -- test/index.js
```
Additionally, `engine.io-client` has a standalone test suite you can run
with `make test` or in the browser with `make test-browser`.
with `make test` which will run node.js and browser tests. You must have zuul setup with
a saucelabs account.

@@ -197,2 +216,4 @@ ## Support

See the `Tests` section above for how to run tests before submitting any patches.
## License

@@ -199,0 +220,0 @@

Sorry, the diff of this file is not supported yet

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