package.json
16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
"_args": [
[
{
"raw": "engine.io-client@~3.1.0",
"scope": null,
"escapedName": "engine.io-client",
"name": "engine.io-client",
"rawSpec": "~3.1.0",
"spec": ">=3.1.0 <3.2.0",
"type": "range"
},
"/Users/fzy/project/3mang/node_modules/socket.io-client"
]
],
"_from": "engine.io-client@>=3.1.0 <3.2.0",
"_id": "engine.io-client@3.1.1",
"_inCache": true,
"_location": "/engine.io-client",
"_nodeVersion": "6.9.4",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/engine.io-client-3.1.1.tgz_1495176579365_0.10497027798555791"
},
"_npmUser": {
"name": "darrachequesne",
"email": "damien.arrachequesne@gmail.com"
},
"_npmVersion": "3.10.10",
"_phantomChildren": {},
"_requested": {
"raw": "engine.io-client@~3.1.0",
"scope": null,
"escapedName": "engine.io-client",
"name": "engine.io-client",
"rawSpec": "~3.1.0",
"spec": ">=3.1.0 <3.2.0",
"type": "range"
},
"_requiredBy": [
"/socket.io-client"
],
"_resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.1.tgz",
"_shasum": "415a9852badb14fa008fa3ef1e31608db6761325",
"_shrinkwrap": null,
"_spec": "engine.io-client@~3.1.0",
"_where": "/Users/fzy/project/3mang/node_modules/socket.io-client",
"browser": {
"ws": false,
"xmlhttprequest-ssl": "./lib/xmlhttprequest.js"
},
"bugs": {
"url": "https://github.com/socketio/engine.io-client/issues"
},
"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.6.4",
"engine.io-parser": "~2.1.1",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"parsejson": "0.0.3",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
"ws": "~2.3.1",
"xmlhttprequest-ssl": "1.5.3",
"yeast": "0.1.2"
},
"description": "Client for the realtime Engine",
"devDependencies": {
"babel-core": "^6.24.0",
"babel-eslint": "4.1.7",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.0",
"blob": "^0.0.4",
"concat-stream": "^1.6.0",
"del": "^2.2.2",
"derequire": "^2.0.6",
"engine.io": "3.1.0",
"eslint-config-standard": "4.4.0",
"eslint-plugin-standard": "1.3.1",
"expect.js": "^0.3.1",
"express": "4.15.2",
"gulp": "3.9.1",
"gulp-eslint": "1.1.1",
"gulp-file": "^0.3.0",
"gulp-istanbul": "^1.1.1",
"gulp-mocha": "^4.3.0",
"gulp-task-listing": "1.0.1",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"webpack": "1.12.12",
"webpack-stream": "^3.2.0",
"zuul": "^3.11.1",
"zuul-builder-webpack": "^1.2.0",
"zuul-ngrok": "4.0.0"
},
"directories": {},
"dist": {
"shasum": "415a9852badb14fa008fa3ef1e31608db6761325",
"tarball": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.1.tgz"
},
"files": [
"index.js",
"lib/",
"engine.io.js"
],
"gitHead": "b949abc6e11e507449b0063c7e45b29eb1b6d1f5",
"homepage": "https://github.com/socketio/engine.io-client",
"license": "MIT",
"maintainers": [
{
"name": "darrachequesne",
"email": "damien.arrachequesne@gmail.com"
},
{
"name": "rauchg",
"email": "rauchg@gmail.com"
}
],
"name": "engine.io-client",
"optionalDependencies": {},
"readme": "\n# Engine.IO client\n\n[](http://travis-ci.org/socketio/engine.io-client)\n[](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 - `transportOptions` (`Object`): hash of options, indexed by transport name, overriding the common options for the given transport\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 - `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 - **Polling-only options**\n - `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)\n - **Websocket-only options**\n - `protocols` (`Array`): a list of subprotocols (see [MDN reference](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols))\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",
"repository": {
"type": "git",
"url": "git+https://github.com/socketio/engine.io-client.git"
},
"scripts": {
"test": "gulp test"
},
"version": "3.1.1"
}