{"_id":"koa-websocket","_rev":"434897","name":"koa-websocket","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","dist-tags":{"latest":"6.0.0","next":"3.0.1"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"time":{"modified":"2021-08-05T06:10:04.000Z","created":"2015-03-08T23:07:31.840Z","6.0.0":"2019-07-08T11:01:36.934Z","5.0.1":"2018-05-23T15:30:42.990Z","5.0.0":"2018-05-21T21:28:02.645Z","4.1.0":"2017-11-05T22:47:20.096Z","4.0.0":"2017-05-06T16:35:36.423Z","2.1.0":"2016-10-01T13:04:53.313Z","3.0.1":"2016-10-01T12:41:12.909Z","2.0.0":"2016-06-01T19:09:51.297Z","1.1.0":"2015-08-29T19:20:03.213Z","1.0.0":"2015-07-05T13:45:00.295Z","0.1.2":"2015-05-14T23:08:56.781Z","0.1.1":"2015-05-06T14:26:44.073Z","0.1.0":"2015-03-08T23:07:31.840Z"},"users":{"shanewholloway":true,"kaerimichi":true},"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"versions":{"6.0.0":{"name":"koa-websocket","version":"6.0.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js","lint":"eslint ."},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^4.0.1","koa-compose":"^4.1.0","ws":"^7.0.1"},"devDependencies":{"eslint":"^6.0.1","eslint-config-airbnb":"^17.1.1","eslint-plugin-import":"^2.18.0","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-react":"^7.14.2","koa":"^2.5.3","koa-route":"^3.2.0","mocha":"^6.1.4"},"gitHead":"29f0b0caf1be370b55332d2cfd0b4eec82b6f207","_id":"koa-websocket@6.0.0","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"shasum":"7fb7698a7004c07aac663b15e84bf4bc99901352","size":8315,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-6.0.0.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-websocket_6.0.0_1562583696765_0.30494519976265755"},"_hasShrinkwrap":false,"publish_time":1562583696934,"_cnpm_publish_time":1562583696934},"5.0.1":{"name":"koa-websocket","version":"5.0.1","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js","lint":"eslint ."},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^3.1.0","koa-compose":"^4.0.0","ws":"^5.2.0"},"devDependencies":{"eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-plugin-import":"^2.12.0","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-react":"^7.8.2","koa":"^2.5.1","koa-route":"^3.2.0","mocha":"^5.2.0"},"gitHead":"11cc0aecd0c4905364aeb77b349247ffb513c8bf","_id":"koa-websocket@5.0.1","_npmVersion":"5.6.0","_nodeVersion":"10.1.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"41413361a0730b886ec3b070e43d78449c8da12b","size":7622,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-5.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-5.0.1.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-websocket_5.0.1_1527089442923_0.07352857315601025"},"_hasShrinkwrap":false,"publish_time":1527089442990,"_cnpm_publish_time":1527089442990},"5.0.0":{"name":"koa-websocket","version":"5.0.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS --timeout 20000 test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^3.1.0","koa-compose":"^4.0.0","npm":"^6.0.1","ws":"^5.2.0"},"devDependencies":{"eslint":"^4.19.1","koa":"^2.5.1","koa-route":"^3.2.0","mocha":"^5.2.0"},"gitHead":"d8ef22accc8242c07849ac67edf0f7f37fddc027","_id":"koa-websocket@5.0.0","_npmVersion":"5.6.0","_nodeVersion":"10.1.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"a12683ce05667ccd9ffcbee8c0280ea4b726cdc6","size":7238,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-5.0.0.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-websocket_5.0.0_1526938082575_0.2144337937484464"},"_hasShrinkwrap":false,"publish_time":1526938082645,"_cnpm_publish_time":1526938082645},"4.1.0":{"name":"koa-websocket","version":"4.1.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^4.0.0","ws":"^2.3.1"},"devDependencies":{"eslint":"^4.6.1","koa":"^2.2.0","koa-route":"^3.2.0","mocha":"^3.3.0"},"gitHead":"ff333bb86add0ad4fa5236af252985987a05e532","_id":"koa-websocket@4.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"3558d047db3ad70e4ea5181cae88c62c1e12224d","size":7196,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-4.1.0.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-websocket-4.1.0.tgz_1509922039164_0.2577500066254288"},"directories":{},"publish_time":1509922040096,"_hasShrinkwrap":false,"_cnpm_publish_time":1509922040096},"4.0.0":{"name":"koa-websocket","version":"4.0.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^4.0.0","ws":"^2.3.1"},"devDependencies":{"koa":"^2.2.0","koa-route":"^3.2.0","mocha":"^3.3.0"},"gitHead":"873454d896481a55487bd5367012f03f14e8c71f","_id":"koa-websocket@4.0.0","_shasum":"bd3b6d569b03a186e75f3b2317e4ae0516d8fb5f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"bd3b6d569b03a186e75f3b2317e4ae0516d8fb5f","size":3055,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-4.0.0.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-websocket-4.0.0.tgz_1494088534494_0.1547160737682134"},"directories":{},"publish_time":1494088536423,"_hasShrinkwrap":false,"_cnpm_publish_time":1494088536423},"2.1.0":{"name":"koa-websocket","version":"2.1.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^1.1.0"},"devDependencies":{"koa":"^1.0.0","koa-route":"^2.4.0","mocha":"^3.1.0"},"gitHead":"4ef79c0c3285d0592309dab31cc86e35a50f949a","_id":"koa-websocket@2.1.0","_shasum":"31afe91b2e7784ff4bf009b35d6be24898277ec2","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.7.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"31afe91b2e7784ff4bf009b35d6be24898277ec2","size":3285,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-2.1.0.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/koa-websocket-2.1.0.tgz_1475327091963_0.534685445483774"},"directories":{},"publish_time":1475327093313,"_cnpm_publish_time":1475327093313,"_hasShrinkwrap":false},"3.0.1":{"name":"koa-websocket","version":"3.0.1","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^3.0.0","ws":"^1.1.0"},"devDependencies":{"koa":"^2.0.0-alpha.7","koa-route":"^3.2.0","mocha":"^2.5.3"},"gitHead":"4eb6bba3e63a4750124abaaf7887bad39b60496d","_id":"koa-websocket@3.0.1","_shasum":"582720faaa6d90f8a0fec5bd86f6b3ce9ab814c5","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.7.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"582720faaa6d90f8a0fec5bd86f6b3ce9ab814c5","size":2680,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-3.0.1.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-websocket-3.0.1.tgz_1475325671195_0.39513094536960125"},"directories":{},"publish_time":1475325672909,"_cnpm_publish_time":1475325672909,"_hasShrinkwrap":false},"2.0.0":{"name":"koa-websocket","version":"2.0.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^1.1.0"},"devDependencies":{"koa":"^1.0.0","koa-route":"^2.4.0","mocha":"^2.5.3"},"gitHead":"7ec55094beaf3d11325ed35d21e898ed0c867b84","_id":"koa-websocket@2.0.0","_shasum":"66fec5b72be18729a42f26e1973c9d8f154b4cba","_from":".","_npmVersion":"3.9.2","_nodeVersion":"6.2.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"66fec5b72be18729a42f26e1973c9d8f154b4cba","size":2408,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-2.0.0.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-websocket-2.0.0.tgz_1464808189149_0.38850905979052186"},"directories":{},"publish_time":1464808191297,"_cnpm_publish_time":1464808191297,"_hasShrinkwrap":false},"1.1.0":{"name":"koa-websocket","version":"1.1.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^0.8.0"},"devDependencies":{"koa":"^1.0.0","koa-route":"^2.4.0","mocha":"~2.2.5"},"gitHead":"dda313804aa283ee334647f51bd07de4025fedba","_id":"koa-websocket@1.1.0","_shasum":"7d80ff012801e63e10c422cfaa57c0777ac43475","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"dist":{"shasum":"7d80ff012801e63e10c422cfaa57c0777ac43475","size":2258,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-1.1.0.tgz"},"directories":{},"publish_time":1440876003213,"_cnpm_publish_time":1440876003213,"_hasShrinkwrap":false},"1.0.0":{"name":"koa-websocket","version":"1.0.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket.git"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^0.7.2"},"devDependencies":{"koa":"^0.21.0","koa-route":"^2.4.0","mocha":"~2.2.5"},"gitHead":"64f5001c7a601a9ef6ce0b851ed54a267e88c071","_id":"koa-websocket@1.0.0","_shasum":"c98089b1de60f6b005a31454c3d651d960cecb0e","_from":".","_npmVersion":"3.0.0","_nodeVersion":"2.3.0","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"dist":{"shasum":"c98089b1de60f6b005a31454c3d651d960cecb0e","size":2289,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-1.0.0.tgz"},"directories":{},"publish_time":1436103900295,"_cnpm_publish_time":1436103900295,"_hasShrinkwrap":false},"0.1.2":{"name":"koa-websocket","version":"0.1.2","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^0.7.2"},"devDependencies":{"koa":"^0.18.1","koa-route":"^2.4.0","mocha":"~2.1.0"},"gitHead":"bf9c4360a08884f2af61e3606424f25e8b129743","_id":"koa-websocket@0.1.2","_shasum":"92ecaf7d3bc7a49e2a56c16dd161d641fa639f6f","_from":".","_npmVersion":"2.7.6","_nodeVersion":"2.0.1","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"92ecaf7d3bc7a49e2a56c16dd161d641fa639f6f","size":1922,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-0.1.2.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"directories":{},"publish_time":1431644936781,"_cnpm_publish_time":1431644936781,"_hasShrinkwrap":false},"0.1.1":{"name":"koa-websocket","version":"0.1.1","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha $NODE_FLAGS test/test.js"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^0.7.1"},"devDependencies":{"koa":"^0.18.1","koa-route":"^2.4.0","mocha":"~2.1.0"},"gitHead":"bf9c4360a08884f2af61e3606424f25e8b129743","_id":"koa-websocket@0.1.1","_shasum":"b5a950109bb066946d4d08ab876b14e34ac547a8","_from":".","_npmVersion":"2.7.6","_nodeVersion":"1.8.1","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"dist":{"shasum":"b5a950109bb066946d4d08ab876b14e34ac547a8","size":1933,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-0.1.1.tgz"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"directories":{},"publish_time":1430922404073,"_cnpm_publish_time":1430922404073,"_hasShrinkwrap":false},"0.1.0":{"name":"koa-websocket","version":"0.1.0","description":"Light wrapper around Koa providing a websocket middleware handler that is koa-route compatible.","main":"index.js","scripts":{"test":"mocha"},"keywords":["koa","websockets","ws","sockets","routes"],"author":{"name":"Jonathan Cremin","email":"jonathan@crem.in","url":"https://crem.in"},"repository":{"type":"git","url":"git://github.com/kudos/koa-websocket"},"bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"homepage":"https://github.com/kudos/koa-websocket","license":"MIT","dependencies":{"co":"^4.4.0","debug":"^2.1.2","koa-compose":"^2.3.0","ws":"^0.7.1"},"devDependencies":{"koa":"^0.18.1","koa-route":"^2.4.0","mocha":"^2.2.0"},"gitHead":"ae4d068dd111dc73dce607b2bc0aff6f24f7e0df","_id":"koa-websocket@0.1.0","_shasum":"b617b9bc2c1ee9e0b74ad76c527573aae8c0a533","_from":".","_npmVersion":"2.6.0","_nodeVersion":"1.4.1","_npmUser":{"name":"kudos","email":"jonathan@crem.in"},"maintainers":[{"name":"kudos","email":"jonathan@crem.in"}],"dist":{"shasum":"b617b9bc2c1ee9e0b74ad76c527573aae8c0a533","size":1743,"noattachment":false,"key":"/koa-websocket/-/koa-websocket-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/koa-websocket/download/koa-websocket-0.1.0.tgz"},"directories":{},"publish_time":1425856051840,"_cnpm_publish_time":1425856051840,"_hasShrinkwrap":false}},"readme":"# koa-websocket\n\n[![Circle CI](https://circleci.com/gh/kudos/koa-websocket.svg?style=svg)](https://circleci.com/gh/kudos/koa-websocket)\n\n> Koa v2 is now the default. For Koa v1 support install with koa-websocket@2 and see the `legacy` branch.\n\nSupports `ws://` and `wss://`\n\n## Installation\n\n`npm install koa-websocket`\n\n## Usage\n\n```js\nconst Koa = require('koa'),\n  route = require('koa-route'),\n  websockify = require('koa-websocket');\n\nconst app = websockify(new Koa());\n\n// Regular middleware\n// Note it's app.ws.use and not app.use\napp.ws.use(function(ctx, next) {\n  // return `next` to pass the context (ctx) on to the next ws middleware\n  return next(ctx);\n});\n\n// Using routes\napp.ws.use(route.all('/test/:id', function (ctx) {\n  // `ctx` is the regular koa context created from the `ws` onConnection `socket.upgradeReq` object.\n  // the websocket is added to the context on `ctx.websocket`.\n  ctx.websocket.send('Hello World');\n  ctx.websocket.on('message', function(message) {\n    // do something with the message from client\n        console.log(message);\n  });\n}));\n\napp.listen(3000);\n```\n\nExample with Let's Encrypt ([the Greenlock package](https://git.daplie.com/Daplie/greenlock-koa)):\n\n```js\nconst Koa = require('koa');\nconst greenlock = require('greenlock-express');\nconst websockify = require('koa-websocket');\n \nconst le = greenlock.create({\n  // all your sweet Let's Encrypt options here\n});\n \n// the magic happens right here\nconst app = websockify(new Koa(), wsOptions, le.httpsOptions);\n \napp.ws.use((ctx) => {\n   // the websocket is added to the context as `ctx.websocket`.\n  ctx.websocket.on('message', function(message) {\n    // do something\n  });\n});\n \napp.listen(3000);\n```\n\nWith custom websocket options.\n\n```js\nconst Koa = require('koa'),\n  route = require('koa-route'),\n  websockify = require('koa-websocket');\n\nconst wsOptions = {};\nconst app = websockify(new Koa(), wsOptions);\n\napp.ws.use(route.all('/', (ctx) => {\n   // the websocket is added to the context as `ctx.websocket`.\n  ctx.websocket.on('message', function(message) {\n    // print message from the client\n    console.log(message);\n  });\n}));\n\napp.listen(3000);\n```\n\n## API\n#### websockify(KoaApp, [WebSocketOptions], [httpsOptions])\nThe WebSocket options object just get passed right through to the `new WebSocketServer(options)` call.\n\nThe optional HTTPS options object gets passed right into `https.createServer(options)`. If the HTTPS options are \npassed in, koa-websocket will use the built-in Node HTTPS server to provide support for the `wss://` protocol.\n\n## License\nMIT\n","_attachments":{},"homepage":"https://github.com/kudos/koa-websocket","bugs":{"url":"https://github.com/kudos/koa-websocket/issues"},"license":"MIT"}