127 lines
10 KiB
JSON
127 lines
10 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "ws@^1.1.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "ws",
|
||
|
"name": "ws",
|
||
|
"rawSpec": "^1.1.0",
|
||
|
"spec": ">=1.1.0 <2.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/react-native"
|
||
|
]
|
||
|
],
|
||
|
"_from": "ws@>=1.1.0 <2.0.0",
|
||
|
"_id": "ws@1.1.5",
|
||
|
"_inCache": true,
|
||
|
"_location": "/ws",
|
||
|
"_nodeVersion": "8.9.1",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "s3://npm-registry-packages",
|
||
|
"tmp": "tmp/ws-1.1.5.tgz_1510160102092_0.6812816471792758"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "lpinca",
|
||
|
"email": "luigipinca@gmail.com"
|
||
|
},
|
||
|
"_npmVersion": "5.5.1",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "ws@^1.1.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "ws",
|
||
|
"name": "ws",
|
||
|
"rawSpec": "^1.1.0",
|
||
|
"spec": ">=1.1.0 <2.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/metro",
|
||
|
"/react-native"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz",
|
||
|
"_shasum": "cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "ws@^1.1.0",
|
||
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/react-native",
|
||
|
"author": {
|
||
|
"name": "Einar Otto Stangvik",
|
||
|
"email": "einaros@gmail.com",
|
||
|
"url": "http://2x.io"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/websockets/ws/issues"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"options": ">=0.0.5",
|
||
|
"ultron": "1.0.x"
|
||
|
},
|
||
|
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
|
||
|
"devDependencies": {
|
||
|
"ansi": "0.3.x",
|
||
|
"benchmark": "0.3.x",
|
||
|
"bufferutil": "1.2.x",
|
||
|
"expect.js": "0.3.x",
|
||
|
"istanbul": "^0.4.1",
|
||
|
"mocha": "2.3.x",
|
||
|
"should": "8.0.x",
|
||
|
"tinycolor": "0.0.x",
|
||
|
"utf-8-validate": "1.2.x"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==",
|
||
|
"shasum": "cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51",
|
||
|
"tarball": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz"
|
||
|
},
|
||
|
"files": [
|
||
|
"index.js",
|
||
|
"lib"
|
||
|
],
|
||
|
"gitHead": "24edef58a0aab05e8220f76bd2377614dd4eee85",
|
||
|
"homepage": "https://github.com/websockets/ws",
|
||
|
"keywords": [
|
||
|
"Hixie",
|
||
|
"HyBi",
|
||
|
"Push",
|
||
|
"RFC-6455",
|
||
|
"WebSocket",
|
||
|
"WebSockets",
|
||
|
"real-time"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"main": "index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "lpinca",
|
||
|
"email": "luigipinca@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "v1",
|
||
|
"email": "npm@3rd-Eden.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "3rdeden",
|
||
|
"email": "npm@3rd-Eden.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "einaros",
|
||
|
"email": "einaros@gmail.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "ws",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# ws: a node.js websocket library\n\n[![Build Status](https://travis-ci.org/websockets/ws.svg?branch=master)](https://travis-ci.org/websockets/ws)\n\n`ws` is a simple to use WebSocket implementation, up-to-date against RFC-6455,\nand [probably the fastest WebSocket library for node.js][archive].\n\nPasses the quite extensive Autobahn test suite. See http://websockets.github.com/ws\nfor the full reports.\n\n## Protocol support\n\n* **Hixie draft 76** (Old and deprecated, but still in use by Safari and Opera.\n Added to ws version 0.4.2, but server only. Can be disabled by setting the\n `disableHixie` option to true.)\n* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`)\n* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`)\n\n### Installing\n\n```\nnpm install --save ws\n```\n\n### Opt-in for performance\n\nThere are 2 optional modules that can be installed along side with the `ws`\nmodule. These modules are binary addons which improve certain operations, but as\nthey are binary addons they require compilation which can fail if no c++\ncompiler is installed on the host system.\n\n- `npm install --save bufferutil`: Improves internal buffer operations which\n allows for faster processing of masked WebSocket frames and general buffer\n operations.\n- `npm install --save utf-8-validate`: The specification requires validation of\n invalid UTF-8 chars, some of these validations could not be done in JavaScript\n hence the need for a binary addon. In most cases you will already be\n validating the input that you receive for security purposes leading to double\n validation. But if you want to be 100% spec-conforming and have fast\n validation of UTF-8 then this module is a must.\n\n### Sending and receiving text data\n\n```js\nvar WebSocket = require('ws');\nvar ws = new WebSocket('ws://www.host.com/path');\n\nws.on('open', function open() {\n ws.send('something');\n});\n\nws.on('message', function(data, flags) {\n // flags.binary will be set if a binary data is received.\n // flags.masked will be set if the data was masked.\n});\n```\n\n### Sending binary data\n\n```js\nvar WebSocket = require('ws');\nvar ws = new WebSocket('ws://www.host.com/path');\n\nws.on('open', function open() {\n var array = new Float32Array(5);\n\n for (var i = 0; i < array.length; ++i) {\n array[i] = i / 2;\n }\n\n ws.send(array, { binary: true, mask: true });\n});\n```\n\nSetting `mask`, as done for the send options above, will cause the data to be\nmasked according to the WebSocket protocol. The same option applies for text\ndata.\n\n### Server example\n\n```js\nvar WebSocketServer = require('ws').Server\n , wss = new WebSocketServer({ port: 8080 });\n\nwss.on('connection', function connection(ws) {\n ws.on('message', function incoming(message) {\n console.log('received: %s', message);\n });\n\n ws.send('something');\n});\n```\n\n### ExpressJS example\n\n```js\nvar server = require('http').createServer()\n , url = require('url')\n , WebSocketServer = require('ws').Server\n , wss = new WebSocketServer({ server: server })\n , express = require('express')\n , app = express()\n , port = 4080;\n\napp.use(function (req, res) {\n res.send({ msg: \"hello\" });\n});\n\nwss.on('connection', function connection(ws) {\n var location = url.parse(ws.upgradeReq.url, true);\n // you might use location.query.access_token to authenticate or share sessions\n // or ws.upgradeReq.headers.cookie (see http://stackoverflow.com/a/16395220/151312)\n\n ws.on('message', function incoming(message) {\n console.log('received: %s', message);\n });\n\n ws.send('something');\n});\n\nserver.on('request', app);\nserver.listen(port, function () { console.log('Listening on ' + server.address().port) });\n```\n\n### Server sending broadcast data\n\n```js\nvar WebSocketServer = require('ws').Server\n , wss = new WebSocketServer({ port: 8080 });\n\nwss.broadcast = function broadcast(data) {\n wss.clients.forEach(function each(client) {\n client.send(data);\n });\n};\n```\n\n### Error handli
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/websockets/ws.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "make test"
|
||
|
},
|
||
|
"version": "1.1.5"
|
||
|
}
|