package.json
19.8 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
{
"_args": [
[
{
"raw": "socket.io",
"scope": null,
"escapedName": "socket.io",
"name": "socket.io",
"rawSpec": "",
"spec": "latest",
"type": "tag"
},
"/Users/fzy/project/3mang"
]
],
"_from": "socket.io@latest",
"_id": "socket.io@2.0.3",
"_inCache": true,
"_location": "/socket.io",
"_nodeVersion": "6.9.4",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/socket.io-2.0.3.tgz_1497269178944_0.7451606099493802"
},
"_npmUser": {
"name": "darrachequesne",
"email": "damien.arrachequesne@gmail.com"
},
"_npmVersion": "3.10.10",
"_phantomChildren": {},
"_requested": {
"raw": "socket.io",
"scope": null,
"escapedName": "socket.io",
"name": "socket.io",
"rawSpec": "",
"spec": "latest",
"type": "tag"
},
"_requiredBy": [
"#DEV:/",
"#USER"
],
"_resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz",
"_shasum": "4359f06a24933ae6bd087798af78c680eae345e3",
"_shrinkwrap": null,
"_spec": "socket.io",
"_where": "/Users/fzy/project/3mang",
"bugs": {
"url": "https://github.com/socketio/socket.io/issues"
},
"contributors": [
{
"name": "Guillermo Rauch",
"email": "rauchg@gmail.com"
},
{
"name": "Arnout Kazemier",
"email": "info@3rd-eden.com"
},
{
"name": "Vladimir Dronnikov",
"email": "dronnikov@gmail.com"
},
{
"name": "Einar Otto Stangvik",
"email": "einaros@gmail.com"
}
],
"dependencies": {
"debug": "~2.6.6",
"engine.io": "~3.1.0",
"object-assign": "~4.1.1",
"socket.io-adapter": "~1.1.0",
"socket.io-client": "~2.0.2",
"socket.io-parser": "~3.1.1"
},
"description": "node.js realtime framework server",
"devDependencies": {
"babel-preset-es2015": "^6.24.1",
"del": "^2.2.2",
"expect.js": "0.3.1",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-istanbul": "^1.1.1",
"gulp-mocha": "^4.3.1",
"gulp-task-listing": "1.0.1",
"istanbul": "^0.4.5",
"mocha": "^3.3.0",
"superagent": "1.6.1",
"supertest": "1.1.0"
},
"directories": {},
"dist": {
"shasum": "4359f06a24933ae6bd087798af78c680eae345e3",
"tarball": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz"
},
"files": [
"lib/"
],
"gitHead": "65ece01135e1a3a4b517ed5c599eb5a7a3401f1a",
"homepage": "https://github.com/socketio/socket.io#readme",
"keywords": [
"realtime",
"framework",
"websocket",
"tcp",
"events",
"socket",
"io"
],
"license": "MIT",
"main": "./lib/index",
"maintainers": [
{
"name": "darrachequesne",
"email": "damien.arrachequesne@gmail.com"
},
{
"name": "rauchg",
"email": "rauchg@gmail.com"
}
],
"name": "socket.io",
"optionalDependencies": {},
"readme": "\n# socket.io\n\n[](#backers) [](#sponsors)\n[](https://travis-ci.org/socketio/socket.io)\n[](https://david-dm.org/socketio/socket.io)\n[](https://david-dm.org/socketio/socket.io#info=devDependencies)\n[](https://www.npmjs.com/package/socket.io)\n\n[](https://slackin-socketio.now.sh)\n\n## Features\n\nSocket.IO enables real-time bidirectional event-based communication. It consists in:\n\n- a Node.js server (this repository)\n- a [Javascript client library](https://github.com/socketio/socket.io-client) for the browser (or a Node.js client)\n\nSome implementations in other languages are also available:\n\n- [Java](https://github.com/socketio/socket.io-client-java)\n- [C++](https://github.com/socketio/socket.io-client-cpp)\n- [Swift](https://github.com/socketio/socket.io-client-swift)\n\nIts main features are:\n\n#### Reliability\n\nConnections are established even in the presence of:\n - proxies and load balancers.\n - personal firewall and antivirus software.\n\nFor this purpose, it relies on [Engine.IO](https://github.com/socketio/engine.io), which first establishes a long-polling connection, then tries to upgrade to better transports that are \"tested\" on the side, like WebSocket. Please see the [Goals](https://github.com/socketio/engine.io#goals) section for more information.\n\n#### Auto-reconnection support\n\nUnless instructed otherwise a disconnected client will try to reconnect forever, until the server is available again. Please see the available reconnection options [here](https://github.com/socketio/socket.io-client/blob/master/docs/API.md#new-managerurl-options).\n\n#### Disconnection detection\n\nAn heartbeat mechanism is implemented at the Engine.IO level, allowing both the server and the client to know when the other one is not responding anymore.\n\nThat functionality is achieved with timers set on both the server and the client, with timeout values (the `pingInterval` and `pingTimeout` parameters) shared during the connection handshake. Those timers require any subsequent client calls to be directed to the same server, hence the `sticky-session` requirement when using multiples nodes.\n\n#### Binary support\n\nAny serializable data structures can be emitted, including:\n\n- [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) and [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) in the browser\n- [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) and [Buffer](https://nodejs.org/api/buffer.html) in Node.js\n\n#### Simple and convenient API\n\nSample code:\n\n```js\nio.on('connection', function(socket){\n socket.emit('request', /* */); // emit an event to the socket\n io.emit('broadcast', /* */); // emit an event to all connected sockets\n socket.on('reply', function(){ /* */ }); // listen to the event\n});\n```\n\n#### Cross-browser\n\nBrowser support is tested in Saucelabs:\n\n[](https://saucelabs.com/u/socket)\n\n#### Multiplexing support\n\nIn order to create separation of concerns within your application (for example per module, or based on permissions), Socket.IO allows you to create several `Namespaces`, which will act as separate communication channels but will share the same underlying connection.\n\n#### Room support\n\nWithin each `Namespace`, you can define arbitrary channels, called `Rooms`, that sockets can join and leave. You can then broadcast to any given room, reaching every socket that has joined it.\n\nThis is a useful feature to send notifications to a group of users, or to a given user connected on several devices for example.\n\n\n**Note:** Socket.IO is not a WebSocket implementation. Although Socket.IO indeed uses WebSocket as a transport when possible, it adds some metadata to each packet: the packet type, the namespace and the ack id when a message acknowledgement is needed. That is why a WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a WebSocket server (like `ws://echo.websocket.org`) either. Please see the protocol specification [here](https://github.com/socketio/socket.io-protocol).\n\n## Installation\n\n```bash\nnpm install socket.io --save\n```\n\n## How to use\n\nThe following example attaches socket.io to a plain Node.JS\nHTTP server listening on port `3000`.\n\n```js\nvar server = require('http').createServer();\nvar io = require('socket.io')(server);\nio.on('connection', function(client){\n client.on('event', function(data){});\n client.on('disconnect', function(){});\n});\nserver.listen(3000);\n```\n\n### Standalone\n\n```js\nvar io = require('socket.io')();\nio.on('connection', function(client){});\nio.listen(3000);\n```\n\n### In conjunction with Express\n\nStarting with **3.0**, express applications have become request handler\nfunctions that you pass to `http` or `http` `Server` instances. You need\nto pass the `Server` to `socket.io`, and not the express application\nfunction. Also make sure to call `.listen` on the `server`, not the `app`.\n\n```js\nvar app = require('express')();\nvar server = require('http').createServer(app);\nvar io = require('socket.io')(server);\nio.on('connection', function(){ /* … */ });\nserver.listen(3000);\n```\n\n### In conjunction with Koa\n\nLike Express.JS, Koa works by exposing an application as a request\nhandler function, but only by calling the `callback` method.\n\n```js\nvar app = require('koa')();\nvar server = require('http').createServer(app.callback());\nvar io = require('socket.io')(server);\nio.on('connection', function(){ /* … */ });\nserver.listen(3000);\n```\n\n## Documentation\n\nPlease see the documentation [here](/docs/README.md). Contributions are welcome!\n\n## Debug / logging\n\nSocket.IO is powered by [debug](https://github.com/visionmedia/debug).\nIn order to see all the debug output, run your app with the environment variable\n`DEBUG` including the desired scope.\n\nTo see the output from all of Socket.IO's debugging scopes you can use:\n\n```\nDEBUG=socket.io* node myapp\n```\n\n## Testing\n\n```\nnpm test\n```\nThis runs the `gulp` task `test`. By default the test will be run with the source code in `lib` directory.\n\nSet the environmental variable `TEST_VERSION` to `compat` to test the transpiled es5-compat version of the code.\n\nThe `gulp` task `test` will always transpile the source code into es5 and export to `dist` first before running the test.\n\n\n## Backers\n\nSupport us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/socketio#backer)]\n\n<a href=\"https://opencollective.com/socketio/backer/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/9/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/10/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/10/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/11/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/11/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/12/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/12/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/13/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/13/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/14/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/14/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/15/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/15/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/16/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/16/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/17/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/17/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/18/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/18/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/19/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/19/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/20/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/20/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/21/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/21/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/22/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/22/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/23/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/23/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/24/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/24/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/25/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/25/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/26/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/26/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/27/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/27/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/28/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/28/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/backer/29/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/backer/29/avatar.svg\"></a>\n\n\n## Sponsors\n\nBecome a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/socketio#sponsor)]\n\n<a href=\"https://opencollective.com/socketio/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/9/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/10/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/10/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/11/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/11/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/12/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/12/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/13/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/13/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/14/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/14/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/15/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/15/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/16/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/16/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/17/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/17/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/18/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/18/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/19/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/19/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/20/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/20/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/21/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/21/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/22/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/22/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/23/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/23/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/24/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/24/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/25/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/25/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/26/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/26/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/27/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/27/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/28/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/28/avatar.svg\"></a>\n<a href=\"https://opencollective.com/socketio/sponsor/29/website\" target=\"_blank\"><img src=\"https://opencollective.com/socketio/sponsor/29/avatar.svg\"></a>\n\n\n## License\n\n[MIT](LICENSE)\n",
"readmeFilename": "Readme.md",
"repository": {
"type": "git",
"url": "git://github.com/socketio/socket.io.git"
},
"scripts": {
"test": "gulp test"
},
"version": "2.0.3"
}