{"_id":"websockets","_rev":"10-ae365f8e9ba45dd012b30cb8cddf1e26","name":"websockets","description":"WebSocket Server & Client API","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"websockets","description":"WebSocket Server & Client API","version":"0.1.0","author":{"name":"EastCloud","email":"info@east-cloud.co.jp"},"repository":{"type":"git","url":"git://github.com/EastCloud/node-spreadsheets.git"},"main":"./lib/websockets/websockets","engines":{"node":">=0.4.10"},"licenses":[{"type":"GNU General Public License version 3.0","url":"http://www.gnu.org/copyleft/gpl.html"}],"_npmJsonOpts":{"file":"/Users/okubo/.npm/websockets/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"websockets@0.1.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.5.4","_defaultsLoaded":true,"dist":{"shasum":"be110e608550ab8843af04cefdea9f08db5721df","tarball":"https://registry.npmjs.org/websockets/-/websockets-0.1.0.tgz","integrity":"sha512-xHILLBZOZR36kstgosSnDGIXWg9H7apmpcuupRms86l0y5bTiPYylgJi3muRS5fKgTWO1w+dUK8q/LvaqoUVYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpatbEopA3KuVUwr2NIlB7hpiXjLJ8BlJ5hMBv+8rkoQIgZJ+p+TV6lcUcqCWKQj4E4iiLQcr8Z9KcZAy4NsO8v3A="}]},"maintainers":[{"name":"okubo","email":"okubo@east-cloud.co.jp"}]},"0.1.1":{"name":"websockets","description":"WebSocket Server & Client API","version":"0.1.1","author":{"name":"EastCloud","email":"info@east-cloud.co.jp"},"repository":{"type":"git","url":"https://EastCloud@github.com/EastCloud/node-websockets.git"},"main":"./lib/websockets/websockets","engines":{"node":">=0.4.10"},"licenses":[{"type":"GNU General Public License version 3.0","url":"http://www.gnu.org/copyleft/gpl.html"}],"readme":"\nnode-websockets\n=\n\n##### Web Socket Server and Client API\n\n* supports only `draft-ietf-hybi-thewebsocketprotocol-10`.\n* works with Google Chrome Dev Channel (>14.0.835.2) when using a browser as a WebSocket client.\n\nInstall\n-\n\n    npm install websockets\n\n\nUsage\n-\n\nrequire `websockets`\n\n```js\nvar websockets = require(\"websockets\");\n\n```\n\n### _Server:_\nServer is a wrapper of `http/https` server.\n\n```js\n\n// http based server\nvar server = websockets.createServer();\nserver.on('connect', function(socket) {\n  socket.on('message', function(message) {\n    socket.send('echo a message:' + message);\n    ......\n  });\n}).listen(80);\n\n// https based server\nvar secure = websockets.createServer({\n  key: ssl_key,\n  cert: ssl_cert\n});\nsecure.on('connect', function(socket) {\n  ......\n}).listen(443);\n\n\n```\n\nExtended Servers such as [express](http://expressjs.com/) are also available.\n\n```js\n// In case of 'express'\nvar express = require('express');\n\nvar svr = express.createServer();\nsvr.get('/', function(req, res) {\n  ......\n});\nsvr.configure(function() {\n  ......\n});\n\nvar server = websockets.createServer({\n  server: svr\n});\nserver.on('connect', function(socket) {\n  socket.on('message', function(message) {\n    socket.send('echo a message:' + message);\n    ......\n  });\n}).listen(80);\n\n```\n\n\n### _Client:_\nClient has the interfaces like [html5 WebSocket](http://www.w3.org/TR/2011/WD-websockets-20110419/).\n\n```js\nvar socket = new websockets.WebSocket('wss://127.0.0.1');\nsocket.on('open', function() {\n  socket.send('a message');\n  ......\n});\n\n```\n\nAPIs\n-\n\n### websockets.Server\n\n<br/>\n\n#### Event: 'connect'\n__`function (socket) {}`__\n\nEmitted when client-server opening handshake has succeeded. `socket` is an instance of `WebSocket`.\n  \n<br/>\n\n#### server.broadcast(string)\nNot Implemented.\nSends `string` to all clients connected with `server`.\n\n<br/>\n\n#### server.broadcast(buffer)\nNot Implemented.\nSends binary data(`buffer`) to all clients connected with `server`.\n\n<br/>\n\n### websockets.WebSocket\n\n<br/>\n\n#### Event: 'open'\n__`function () {}`__\n\nEmitted when a client-server connection is successfully established.\n\n<br/>\n\n#### Event: 'message'\n__`function (data) {}`__\n\nEmitted when the socket has received a message. The type of `data` is either `string`(string data) or `Buffer`(binary data).\n\n<br/>\n\n#### Event: 'error'\n__`function (exception) {}`__\n\nEmitted on error. `exception` is an instance of Error.\n\n<br/>\n\n#### Event: 'close'\n__`function () {}`__\n\nEmitted when a client-server connection has closed.\n\n<br/>\n\n#### socket.send(string)\nSends `string` to the other endpoint.\n\n<br/>\n\n#### socket.send(buffer)\nSends binary data(`buffer`) to the other endpoint.\n\n<br/>\n\n#### socket.close()\nSends a connection close request to the other endpoint.\n\n<br/>\nTODO\n=\n* implementation of server broadcast\n","_id":"websockets@0.1.1","dist":{"shasum":"544a7be9de997dab4d1b0f0acf682d3014939276","tarball":"https://registry.npmjs.org/websockets/-/websockets-0.1.1.tgz","integrity":"sha512-v4mH8sHLgs8Z94pu9A68rwolmxmafByzkSUUaxDiZHps/HbFlr/+dTHlEGJW42wHvJdm6+YcSxOfYoiy3X3qAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+QhVecbiJUrJCWncrXE9ngsY4ban2rrP/JQ1G/nD1OAiBzPy5NvfTog/JOGkTSrAF94AYSquc6/LqiQxU66H146w=="}]},"maintainers":[{"name":"okubo","email":"okubo@east-cloud.co.jp"}]},"0.2.0":{"name":"websockets","description":"WebSocket Server & Client API","version":"0.2.0","author":{"name":"EastCloud","email":"info@east-cloud.co.jp"},"repository":{"type":"git","url":"https://EastCloud@github.com/EastCloud/node-websockets.git"},"main":"./lib/websockets/websockets","engines":{"node":">=0.4.10"},"licenses":[{"type":"MIT","url":"https://github.com/EastCloud/node-websockets/blob/master/LICENSE.md"}],"readme":"\nnode-websockets\n=\n\n##### Web Socket Server and Client API\n\n###### Support Protocols\n* [RFC 6455](http://tools.ietf.org/html/rfc6455)\n* [draft-ietf-hybi-thewebsocketprotocol-10](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10)\n* [draft-ietf-hybi-thewebsocketprotocol-00](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00)\n\n\nInstall\n-\n\n    npm install websockets\n\n\nUsage\n-\n\nrequire `websockets`\n\n```js\nvar websockets = require(\"websockets\");\n\n```\n\n### _Server:_\nServer is a wrapper of `http/https` server.\n\n```js\n\n// http based server\nvar server = websockets.createServer();\nserver.on('connect', function(socket) {\n  socket.on('message', function(message) {\n    socket.send('echo a message:' + message);\n    ......\n  });\n}).listen(80);\n\n// https based server\nvar secure = websockets.createServer({\n  key: ssl_key,\n  cert: ssl_cert\n});\nsecure.on('connect', function(socket) {\n  ......\n}).listen(443);\n\n\n```\n\nExtended Servers such as [express](http://expressjs.com/) are also available.\n\n```js\n// In case of 'express'\nvar express = require('express');\n\nvar svr = express.createServer();\nsvr.get('/', function(req, res) {\n  ......\n});\nsvr.configure(function() {\n  ......\n});\n\nvar server = websockets.createServer({\n  server: svr\n});\nserver.on('connect', function(socket) {\n  socket.on('message', function(message) {\n    socket.send('echo a message:' + message);\n    ......\n  });\n}).listen(80);\n\n```\n\n\n### _Client:_\nClient has the interfaces like [html5 WebSocket](http://www.w3.org/TR/2011/WD-websockets-20110419/).\n\n```js\nvar socket = new websockets.WebSocket('wss://127.0.0.1');\nsocket.on('open', function() {\n  socket.send('a message');\n  ......\n});\n\n```\n\nAPIs\n-\n\n### websockets.Server\n\n<br/>\n\n#### Event: 'connect'\n__`function (socket) {}`__\n\nEmitted when client-server opening handshake has succeeded. `socket` is an instance of `WebSocket`.\n  \n<br/>\n\n#### server.broadcast(string)\nNot Implemented.\nSends `string` to all clients connected with `server`.\n\n<br/>\n\n#### server.broadcast(buffer)\nNot Implemented.\nSends binary data(`buffer`) to all clients connected with `server`.\n\n<br/>\n\n### websockets.WebSocket\n\n<br/>\n\n#### Event: 'open'\n__`function () {}`__\n\nEmitted when a client-server connection is successfully established.\n\n<br/>\n\n#### Event: 'message'\n__`function (data) {}`__\n\nEmitted when the socket has received a message. The type of `data` is either `string`(string data) or `Buffer`(binary data).\n\n<br/>\n\n#### Event: 'error'\n__`function (exception) {}`__\n\nEmitted on error. `exception` is an instance of Error.\n\n<br/>\n\n#### Event: 'close'\n__`function () {}`__\n\nEmitted when a client-server connection has closed.\n\n<br/>\n\n#### socket.send(string)\nSends `string` to the other endpoint.\n\n<br/>\n\n#### socket.send(buffer)\nSends binary data(`buffer`) to the other endpoint.\n\n<br/>\n\n#### socket.close()\nSends a connection close request to the other endpoint.\n\n<br/>\nTODO\n=\n* implementation of server broadcast\n","readmeFilename":"README.md","_id":"websockets@0.2.0","dist":{"shasum":"ba2fe2e9768e6c5ec3abb0469c172f3789cae158","tarball":"https://registry.npmjs.org/websockets/-/websockets-0.2.0.tgz","integrity":"sha512-GjhUvj0PfZMpsRI7BdyyM7wsaGDkDd3uMrFThWNyb3lQy8BxmLWxtE22W7pQpI7z703xht8j1fqVOjRkZIulUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICX7PQIwL38Y0P06Itf3zkpMQRIr7gkqWIMdA5ShUrBVAiABfaCUoIvFU7IXIbcrB0lYXZckneaiU5C0ZynwLQ3j9Q=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"okubo","email":"okubo@east-cloud.co.jp"},"maintainers":[{"name":"okubo","email":"okubo@east-cloud.co.jp"}]}},"maintainers":[{"name":"okubo","email":"okubo@east-cloud.co.jp"}],"time":{"modified":"2022-06-29T00:30:05.367Z","created":"2011-08-27T08:24:14.875Z","0.1.0":"2011-08-27T08:24:18.298Z","0.1.1":"2013-04-12T02:53:56.850Z","0.2.0":"2013-05-17T06:43:12.475Z"},"author":{"name":"EastCloud","email":"info@east-cloud.co.jp"},"repository":{"type":"git","url":"https://EastCloud@github.com/EastCloud/node-websockets.git"},"users":{"phrase":true}}