{
  "name": "engine.io-client",
  "description": "Client for the realtime Engine",
  "license": "MIT",
  "version": "1.8.3",
  "homepage": "https://github.com/socketio/engine.io-client",
  "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": {
    "component-emitter": "1.2.1",
    "component-inherit": "0.0.3",
    "debug": "2.3.3",
    "engine.io-parser": "1.3.2",
    "has-cors": "1.1.0",
    "indexof": "0.0.1",
    "parsejson": "0.0.3",
    "parseqs": "0.0.5",
    "parseuri": "0.0.5",
    "ws": "1.1.2",
    "xmlhttprequest-ssl": "1.5.3",
    "yeast": "0.1.2"
  },
  "devDependencies": {
    "babel-core": "6.4.5",
    "babel-eslint": "4.1.7",
    "babel-loader": "6.2.1",
    "babel-preset-es2015": "6.3.13",
    "blob": "0.0.4",
    "concat-stream": "1.4.6",
    "del": "2.2.0",
    "derequire": "1.2.0",
    "eslint-config-standard": "4.4.0",
    "eslint-plugin-standard": "1.3.1",
    "engine.io": "1.8.3",
    "expect.js": "0.2.0",
    "express": "3.4.8",
    "gulp": "3.9.0",
    "gulp-eslint": "1.1.1",
    "gulp-file": "0.2.0",
    "gulp-istanbul": "0.10.3",
    "gulp-mocha": "2.2.0",
    "gulp-task-listing": "1.0.1",
    "istanbul": "0.2.3",
    "mocha": "1.16.2",
    "webpack": "1.12.12",
    "webpack-stream": "3.1.0",
    "zuul": "3.11.0",
    "zuul-builder-webpack": "1.1.0",
    "zuul-ngrok": "4.0.0"
  },
  "scripts": {
    "test": "gulp test"
  },
  "browser": {
    "ws": false,
    "xmlhttprequest-ssl": "./lib/xmlhttprequest.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/socketio/engine.io-client.git"
  },
  "files": [
    "index.js",
    "lib/",
    "engine.io.js"
  ],
  "readme": "\n# Engine.IO client\n\n[![Build Status](https://travis-ci.org/socketio/engine.io-client.svg?branch=master)](http://travis-ci.org/socketio/engine.io-client)\n[![NPM version](https://badge.fury.io/js/engine.io-client.svg)](http://badge.fury.io/js/engine.io-client)\n\nThis is the client for [Engine.IO](http://github.com/socketio/engine.io),\nthe implementation of transport-based cross-browser/cross-device\nbi-directional communication layer for [Socket.IO](http://github.com/socketio/socket.io).\n\n## How to use\n\n### Standalone\n\nYou can find an `engine.io.js` file in this repository, which is a\nstandalone build you can use as follows:\n\n```html\n<script src=\"/path/to/engine.io.js\"></script>\n<script>\n  // eio = Socket\n  var socket = eio('ws://localhost');\n  socket.on('open', function(){\n    socket.on('message', function(data){});\n    socket.on('close', function(){});\n  });\n</script>\n```\n\n### With browserify\n\nEngine.IO is a commonjs module, which means you can include it by using\n`require` on the browser and package using [browserify](http://browserify.org/):\n\n1. install the client package\n\n    ```bash\n    $ npm install engine.io-client\n    ```\n\n1. write your app code\n\n    ```js\n    var socket = require('engine.io-client')('ws://localhost');\n    socket.on('open', function(){\n      socket.on('message', function(data){});\n      socket.on('close', function(){});\n    });\n    ```\n\n1. build your app bundle\n\n    ```bash\n    $ browserify app.js > bundle.js\n    ```\n\n1. include on your page\n\n    ```html\n    <script src=\"/path/to/bundle.js\"></script>\n    ```\n\n### Sending and receiving binary\n\n```html\n<script src=\"/path/to/engine.io.js\"></script>\n<script>\n  var socket = new eio.Socket('ws://localhost/');\n  socket.binaryType = 'blob';\n  socket.on('open', function () {\n    socket.send(new Int8Array(5));\n    socket.on('message', function(blob){});\n    socket.on('close', function(){ });\n  });\n</script>\n```\n\n### Node.JS\n\nAdd `engine.io-client` to your `package.json` and then:\n\n```js\nvar socket = require('engine.io-client')('ws://localhost');\nsocket.on('open', function(){\n  socket.on('message', function(data){});\n  socket.on('close', function(){});\n});\n```\n\n### Node.js with certificates\n```js\nvar opts = {\n  key: fs.readFileSync('test/fixtures/client.key'),\n  cert: fs.readFileSync('test/fixtures/client.crt'),\n  ca: fs.readFileSync('test/fixtures/ca.crt')\n};\n\nvar socket = require('engine.io-client')('ws://localhost', opts);\nsocket.on('open', function(){\n  socket.on('message', function(data){});\n  socket.on('close', function(){});\n});\n```\n\n### Node.js with extraHeaders\n```js\nvar opts = {\n  extraHeaders: {\n    'X-Custom-Header-For-My-Project': 'my-secret-access-token',\n    'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly'\n  }\n};\n\nvar socket = require('engine.io-client')('ws://localhost', opts);\nsocket.on('open', function(){\n  socket.on('message', function(data){});\n  socket.on('close', function(){});\n});\n```\n\n## Features\n\n- Lightweight\n- Runs on browser and node.js seamlessly\n- Transports are independent of `Engine`\n  - Easy to debug\n  - Easy to unit test\n- Runs inside HTML5 WebWorker\n- Can send and receive binary data\n  - Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer\n    in Node\n  - When XHR2 or WebSockets are used, binary is emitted directly. Otherwise\n    binary is encoded into base64 strings, and decoded when binary types are\n    supported.\n  - With browsers that don't support ArrayBuffer, an object { base64: true,\n    data: dataAsBase64String } is emitted on the `message` event.\n\n## API\n\n### Socket\n\nThe client class. Mixes in [Emitter](http://github.com/component/emitter).\nExposed as `eio` in the browser standalone build.\n\n#### Properties\n\n- `protocol` _(Number)_: protocol revision number\n- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers,\n  and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's\n  supported.\n\n#### Events\n\n- `open`\n  - Fired upon successful connection.\n- `message`\n  - Fired when data is received from the server.\n  - **Arguments**\n    - `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing\n      binary data\n- `close`\n  - Fired upon disconnection. In compliance with the WebSocket API spec, this event may be\n    fired even if the `open` event does not occur (i.e. due to connection error or `close()`).\n- `error`\n  - Fired when an error occurs.\n- `flush`\n  - Fired upon completing a buffer flush\n- `drain`\n  - Fired after `drain` event of transport if writeBuffer is empty\n- `upgradeError`\n  - Fired if an error occurs with a transport we're trying to upgrade to.\n- `upgrade`\n  - Fired upon upgrade success, after the new transport is set\n- `ping`\n  - Fired upon _flushing_ a ping packet (ie: actual packet write out)\n- `pong`\n  - Fired upon receiving a pong packet.\n\n#### Methods\n\n- **constructor**\n    - Initializes the client\n    - **Parameters**\n      - `String` uri\n      - `Object`: optional, options object\n    - **Options**\n      - `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)\n      - `upgrade` (`Boolean`): defaults to true, whether the client should try\n      to upgrade the transport from long-polling to something better.\n      - `forceJSONP` (`Boolean`): forces JSONP for polling transport.\n      - `jsonp` (`Boolean`): determines whether to use JSONP when\n        necessary for polling. If disabled (by settings to false) an error will\n        be emitted (saying \"No transports available\") if no other transports\n        are available. If another transport is available for opening a\n        connection (e.g. WebSocket) that transport\n        will be used instead.\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.\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.\n      - `timestampRequests` (`Boolean`): whether to add the timestamp with each\n        transport request. Note: polling requests are always stamped unless this\n        option is explicitly set to `false` (`false`)\n      - `timestampParam` (`String`): timestamp parameter (`t`)\n      - `policyPort` (`Number`): port the policy server listens on (`843`)\n      - `path` (`String`): path to connect to, default is `/engine.io`\n      - `transports` (`Array`): a list of transports to try (in order).\n      Defaults to `['polling', 'websocket']`. `Engine`\n      always attempts to connect directly with the first one, provided the\n      feature detection test for it passes.\n      - `rememberUpgrade` (`Boolean`): defaults to false.\n        If true and if the previous websocket connection to the server succeeded,\n        the connection attempt will bypass the normal upgrade process and will initially\n        try websocket. A connection attempt following a transport error will use the\n        normal upgrade process. It is recommended you turn this on only when using\n        SSL/TLS connections, or if you know that your network does not block websockets.\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.\n      - `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information.\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.\n      - `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information.\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.\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.\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.\n      - `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension\n        (see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`)\n        - `threshold` (`Number`): data is compressed only if the byte size is above this value. This option is ignored on the browser. (`1024`)\n      - `extraHeaders` (`Object`): Headers that will be passed for each request to the server (via xhr-polling and via websockets). These values then can be used during handshake or for special proxies. Can only be used in Node.js client environment.\n      - `onlyBinaryUpgrades` (`Boolean`): whether transport upgrades should be restricted to transports supporting binary data (`false`)\n      - `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)\n      - `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)\n      - `localAddress` (`String`): the local IP address to connect to\n- `send`\n    - Sends a message to the server\n    - **Parameters**\n      - `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send\n      - `Object`: optional, options object\n      - `Function`: optional, callback upon `drain`\n    - **Options**\n      - `compress` (`Boolean`): whether to compress sending data. This option is ignored and forced to be `true` on the browser. (`true`)\n- `close`\n    - Disconnects the client.\n\n### Transport\n\nThe transport class. Private. _Inherits from EventEmitter_.\n\n#### Events\n\n- `poll`: emitted by polling transports upon starting a new request\n- `pollComplete`: emitted by polling transports upon completing a request\n- `drain`: emitted by polling transports upon a buffer drain\n\n## Tests\n\n`engine.io-client` is used to test\n[engine](http://github.com/socketio/engine.io). Running the `engine.io`\ntest suite ensures the client works and vice-versa.\n\nBrowser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can\nrun the tests locally using the following command.\n\n```\n./node_modules/.bin/zuul --local 8080 -- test/index.js\n```\n\nAdditionally, `engine.io-client` has a standalone test suite you can run\nwith `make test` which will run node.js and browser tests. You must have zuul setup with\na saucelabs account.\n\n## Support\n\nThe support channels for `engine.io-client` are the same as `socket.io`:\n  - irc.freenode.net **#socket.io**\n  - [Google Groups](http://groups.google.com/group/socket_io)\n  - [Website](http://socket.io)\n\n## Development\n\nTo contribute patches, run tests or benchmarks, make sure to clone the\nrepository:\n\n```bash\ngit clone git://github.com/socketio/engine.io-client.git\n```\n\nThen:\n\n```bash\ncd engine.io-client\nnpm install\n```\n\nSee the `Tests` section above for how to run tests before submitting any patches.\n\n## License\n\nMIT - Copyright (c) 2014 Automattic, Inc.\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/socketio/engine.io-client/issues"
  },
  "_id": "engine.io-client@1.8.3",
  "_shasum": "1798ed93451246453d4c6f635d7a201fe940d5ab",
  "_from": "engine.io-client@1.8.3",
  "_resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.3.tgz"
}
