{
  "name": "engine.io-client",
  "description": "Client for the realtime Engine",
  "version": "1.5.1",
  "homepage": "http://socket.io",
  "contributors": [
    {
      "name": "Guillermo Rauch",
      "email": "rauchg@gmail.com"
    },
    {
      "name": "Vladimir Dronnikov",
      "email": "dronnikov@gmail.com"
    },
    {
      "name": "Christoph Dorn",
      "url": "https://github.com/cadorn"
    },
    {
      "name": "Mark Mokryn",
      "email": "mokesmokes@gmail.com"
    }
  ],
  "dependencies": {
    "has-cors": "1.0.3",
    "ws": "0.4.31",
    "xmlhttprequest": "git+ssh://git@git.corp.adobe.com:jhagenst/node-XMLHttpRequest.git#d65d74834ba28582d76f4e8240c2a55652eb6da9",
    "component-emitter": "1.1.2",
    "indexof": "0.0.1",
    "engine.io-parser": "1.2.1",
    "debug": "1.0.4",
    "parseuri": "0.0.4",
    "parsejson": "0.0.1",
    "parseqs": "0.0.2",
    "component-inherit": "0.0.3"
  },
  "devDependencies": {
    "blob": "0.0.2",
    "browserify": "6.2.0",
    "concat-stream": "1.4.6",
    "derequire": "1.2.0",
    "engine.io": "1.5.1",
    "expect.js": "0.2.0",
    "express": "3.4.8",
    "istanbul": "0.2.3",
    "mocha": "1.16.2",
    "zuul": "rase-/zuul#9d3a02"
  },
  "scripts": {
    "test": "make test"
  },
  "browser": {
    "xmlhttprequest": "./lib/xmlhttprequest.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/Automattic/engine.io-client.git"
  },
  "readme": "fork of engine.io-client at 8b2f978 Release 1.5.1 https://github.com/Automattic/engine.io-client\r\n\r\n\r\n# Engine.IO client\r\n\r\n[![Build Status](https://secure.travis-ci.org/Automattic/engine.io-client.png)](http://travis-ci.org/Automattic/engine.io-client)\r\n[![NPM version](https://badge.fury.io/js/engine.io-client.png)](http://badge.fury.io/js/engine.io-client)\r\n\r\nThis is the client for [Engine.IO](http://github.com/automattic/engine.io),\r\nthe implementation of transport-based cross-browser/cross-device\r\nbi-directional communication layer for [Socket.IO](http://github.com/automattic/socket.io).\r\n\r\n## How to use\r\n\r\n### Standalone\r\n\r\nYou can find an `engine.io.js` file in this repository, which is a\r\nstandalone build you can use as follows:\r\n\r\n```html\r\n<script src=\"/path/to/engine.io.js\"></script>\r\n<script>\r\n  // eio = Socket\r\n  var socket = eio('ws://localhost');\r\n  socket.on('open', function(){\r\n    socket.on('message', function(data){});\r\n    socket.on('close', function(){});\r\n  });\r\n</script>\r\n```\r\n\r\n### With browserify\r\n\r\nEngine.IO is a commonjs module, which means you can include it by using\r\n`require` on the browser and package using [browserify](http://browserify.org/):\r\n\r\n1. install the client package\r\n\r\n    ```bash\r\n    $ npm install engine.io-client\r\n    ```\r\n\r\n1. write your app code\r\n\r\n    ```js\r\n    var socket = require('engine.io-client')('ws://localhost');\r\n    socket.on('open', function(){\r\n      socket.on('message', function(data){});\r\n      socket.on('close', function(){});\r\n    });\r\n    ```\r\n\r\n1. build your app bundle\r\n\r\n    ```bash\r\n    $ browserify app.js > bundle.js\r\n    ```\r\n\r\n1. include on your page\r\n\r\n    ```html\r\n    <script src=\"/path/to/bundle.js\"></script>\r\n    ```\r\n\r\n### Sending and receiving binary\r\n\r\n```html\r\n<script src=\"/path/to/engine.io.js\"></script>\r\n<script>\r\n  var socket = new eio.Socket('ws://localhost/');\r\n  socket.binaryType = 'blob';\r\n  socket.on('open', function () {\r\n    socket.send(new Int8Array(5));\r\n    socket.on('message', function(blob){});\r\n    socket.on('close', function(){ });\r\n  });\r\n</script>\r\n```\r\n\r\n### Node.JS\r\n\r\nAdd `engine.io-client` to your `package.json` and then:\r\n\r\n```js\r\nvar socket = require('engine.io-client')('ws://localhost');\r\nsocket.on('open', function(){\r\n  socket.on('message', function(data){});\r\n  socket.on('close', function(){});\r\n});\r\n```\r\n\r\n### Node.js with certificates\r\n```js\r\nvar opts = {\r\n  key: fs.readFileSync('test/fixtures/client.key'),\r\n  cert: fs.readFileSync('test/fixtures/client.crt'),\r\n  ca: fs.readFileSync('test/fixtures/ca.crt')\r\n};\r\n\r\nvar socket = require('engine.io-client')('ws://localhost', opts);\r\nsocket.on('open', function(){\r\n  socket.on('message', function(data){});\r\n  socket.on('close', function(){});\r\n});\r\n```\r\n\r\n## Features\r\n\r\n- Lightweight\r\n- Runs on browser and node.js seamlessly\r\n- Transports are independent of `Engine`\r\n  - Easy to debug\r\n  - Easy to unit test\r\n- Runs inside HTML5 WebWorker\r\n- Can send and receive binary data\r\n  - Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer\r\n    in Node\r\n  - When XHR2 or WebSockets are used, binary is emitted directly. Otherwise\r\n    binary is encoded into base64 strings, and decoded when binary types are\r\n    supported.\r\n  - With browsers that don't support ArrayBuffer, an object { base64: true,\r\n    data: dataAsBase64String } is emitted on the `message` event.\r\n\r\n## API\r\n\r\n### Socket\r\n\r\nThe client class. Mixes in [Emitter](http://github.com/component/emitter).\r\nExposed as `eio` in the browser standalone build.\r\n\r\n#### Properties\r\n\r\n- `protocol` _(Number)_: protocol revision number\r\n- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers,\r\n  and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's\r\n  supported.\r\n\r\n#### Events\r\n\r\n- `open`\r\n  - Fired upon successful connection.\r\n- `message`\r\n  - Fired when data is received from the server.\r\n  - **Arguments**\r\n    - `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing\r\n      binary data\r\n- `close`\r\n  - Fired upon disconnection. In compliance with the WebSocket API spec, this event may be \r\n    fired even if the `open` event does not occur (i.e. due to connection error or `close()`).\r\n- `error`\r\n  - Fired when an error occurs.\r\n- `flush`\r\n  - Fired upon completing a buffer flush\r\n- `drain`\r\n  - Fired after `drain` event of transport if writeBuffer is empty\r\n- `upgradeError`\r\n  - Fired if an error occurs with a transport we're trying to upgrade to.\r\n- `upgrade`\r\n  - Fired upon upgrade success, after the new transport is set\r\n\r\n#### Methods\r\n\r\n- **constructor**\r\n    - Initializes the client\r\n    - **Parameters**\r\n      - `String` uri\r\n      - `Object`: optional, options object\r\n    - **Options**\r\n      - `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)\r\n      - `upgrade` (`Boolean`): defaults to true, whether the client should try\r\n      to upgrade the transport from long-polling to something better.\r\n      - `forceJSONP` (`Boolean`): forces JSONP for polling transport.\r\n      - `jsonp` (`Boolean`): determines whether to use JSONP when\r\n        necessary for polling. If disabled (by settings to false) an error will\r\n        be emitted (saying \"No transports available\") if no other transports\r\n        are available. If another transport is available for opening a\r\n        connection (e.g. WebSocket) that transport\r\n        will be used instead.\r\n      - `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary.\r\n      - `enablesXDR` (`Boolean`): enables XDomainRequest for IE8 to avoid loading bar flashing with click sound. default to `false` because XDomainRequest has a flaw of not sending cookie.\r\n      - `timestampRequests` (`Boolean`): whether to add the timestamp with\r\n        each transport request. Note: this is ignored if the browser is\r\n        IE or Android, in which case requests are always stamped (`false`)\r\n      - `timestampParam` (`String`): timestamp parameter (`t`)\r\n      - `policyPort` (`Number`): port the policy server listens on (`843`)\r\n      - `path` (`String`): path to connect to, default is `/engine.io`\r\n      - `transports` (`Array`): a list of transports to try (in order).\r\n      Defaults to `['polling', 'websocket']`. `Engine`\r\n      always attempts to connect directly with the first one, provided the\r\n      feature detection test for it passes.\r\n      - `rememberUpgrade` (`Boolean`): defaults to false.\r\n        If true and if the previous websocket connection to the server succeeded,\r\n        the connection attempt will bypass the normal upgrade process and will initially\r\n        try websocket. A connection attempt following a transport error will use the \r\n        normal upgrade process. It is recommended you turn this on only when using\r\n        SSL/TLS connections, or if you know that your network does not block websockets.\r\n      - `pfx` (`String`): Certificate, Private key and CA certificates to use for SSL. Can be used in Node.js client environment to manually specify certificate information.\r\n      - `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information.\r\n      - `passphrase` (`String`): A string of passphrase for the private key or pfx. Can be used in Node.js client environment to manually specify certificate information.\r\n      - `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information.\r\n      - `ca` (`String`|`Array`): An authority certificate or array of authority certificates to check the remote host against.. Can be used in Node.js client environment to manually specify certificate information.\r\n      - `ciphers` (`String`): A string describing the ciphers to use or exclude. Consult the [cipher format list](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details on the format.. Can be used in Node.js client environment to manually specify certificate information.\r\n      - `rejectUnauthorized` (`Boolean`): If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Can be used in Node.js client environment to manually specify certificate information.\r\n- `send`\r\n    - Sends a message to the server\r\n    - **Parameters**\r\n      - `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send\r\n      - `Function`: optional, callback upon `drain`\r\n- `close`\r\n    - Disconnects the client.\r\n\r\n### Transport\r\n\r\nThe transport class. Private. _Inherits from EventEmitter_.\r\n\r\n#### Events\r\n\r\n- `poll`: emitted by polling transports upon starting a new request\r\n- `pollComplete`: emitted by polling transports upon completing a request\r\n- `drain`: emitted by polling transports upon a buffer drain\r\n\r\n## Tests\r\n\r\n`engine.io-client` is used to test\r\n[engine](http://github.com/automattic/engine.io). Running the `engine.io`\r\ntest suite ensures the client works and vice-versa.\r\n\r\nBrowser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can\r\nrun the tests locally using the following command.\r\n\r\n```\r\n./node_modules/.bin/zuul --local 8080 -- test/index.js\r\n```\r\n\r\nAdditionally, `engine.io-client` has a standalone test suite you can run\r\nwith `make test` which will run node.js and browser tests. You must have zuul setup with\r\na saucelabs account.\r\n\r\n## Support\r\n\r\nThe support channels for `engine.io-client` are the same as `socket.io`:\r\n  - irc.freenode.net **#socket.io**\r\n  - [Google Groups](http://groups.google.com/group/socket_io)\r\n  - [Website](http://socket.io)\r\n\r\n## Development\r\n\r\nTo contribute patches, run tests or benchmarks, make sure to clone the\r\nrepository:\r\n\r\n```bash\r\ngit clone git://github.com/automattic/engine.io-client.git\r\n```\r\n\r\nThen:\r\n\r\n```bash\r\ncd engine.io-client\r\nnpm install\r\n```\r\n\r\nSee the `Tests` section above for how to run tests before submitting any patches.\r\n\r\n## License\r\n\r\nMIT - Copyright (c) 2014 Automattic, Inc.\r\n\r\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/Automattic/engine.io-client/issues"
  },
  "_id": "engine.io-client@1.5.1",
  "dist": {
    "shasum": "c78fdbe9ed7e4814b43a56dce27982bdc0a99545"
  },
  "_resolved": "git+ssh://git@git.corp.adobe.com:jhagenst/engine.io-client.git#9e0a4296aa4783f1da107e30a4c4e579c417e553",
  "_from": "engine.io-client@git+ssh://git@git.corp.adobe.com:jhagenst/engine.io-client.git#9e0a4296aa4783f1da107e30a4c4e579c417e553"
}
