{"_id":"easy-websocket","_rev":"18-c735ae2612802141fb1ede29b20d97f1","name":"easy-websocket","description":"easy websocket","dist-tags":{"latest":"0.2.1"},"versions":{"0.0.1":{"name":"easy-websocket","version":"0.0.1","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","gitHead":"087e4e78a74636aadcc35030ec9e4d4199e9b941","_id":"easy-websocket@0.0.1","_shasum":"1c3b758dcf3c9b3bfe21d2035bdaae4ae7eaee9a","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"1c3b758dcf3c9b3bfe21d2035bdaae4ae7eaee9a","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.1.tgz","integrity":"sha512-urUXSbZiJ6EWsGOQ5PiCUOa2WhvxrBqlonZwL4WRWcdOTglDR/q0Ngf6eaAhk16tXrjUy35EuLZd9rx2sbXGtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOxmHLYDN272T+TRMkIY8pHrP3jnJIPKFKFCCsWqoCqAIhAOBCE3j2Luz0IDWtw02Deq/yUmvX5F3cRjjxkSripHLF"}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.1.tgz_1461314703859_0.03123948024585843"}},"0.0.2":{"name":"easy-websocket","version":"0.0.2","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","gitHead":"fd2e8437aa91c402c8fac9060215047e827f94dc","_id":"easy-websocket@0.0.2","_shasum":"18a41f3973f89a4f39a47e447ee32c04290b321f","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"18a41f3973f89a4f39a47e447ee32c04290b321f","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.2.tgz","integrity":"sha512-//tgZ7B5vcWSKgkKd7WLCzDaX49fEgO9I/ewALaHfGPubyPOzN7+mUYFqNODI9EiHGc1bXXCRL+CdNzsCfWmpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKtCe3bPdBPEwvxIFqoIIC7zIxHqxsL1knEbXJxJG0JAIhAM3n7f8iu2bFan1+PYmd9I36jNU08Np283NDyvGGAM3f"}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.2.tgz_1461317057641_0.8193160055670887"}},"0.0.3":{"name":"easy-websocket","version":"0.0.3","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","directories":{"example":"example"},"repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"fd2e8437aa91c402c8fac9060215047e827f94dc","_id":"easy-websocket@0.0.3","_shasum":"e37c64c2c7617bc76a3c43f89e3d8fc644b02cda","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"e37c64c2c7617bc76a3c43f89e3d8fc644b02cda","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.3.tgz","integrity":"sha512-/2kvzAKcN1YhwMjBiuKakCgtlR09wv+UlZOK0JjNdbr2BMXBL+lErC6c28mogqJaLq29nuV6cCfRYrjFES7a9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBksdZh9OgW7MaJS7GWDCy6qzsyVCpUVC535ZxiwZIE0AiBTp96f56Epr2x+Dj+lbHJolnKVV9ckAkeIVVBNGgJr/g=="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.3.tgz_1461373601569_0.08006246970035136"}},"0.0.4":{"name":"easy-websocket","version":"0.0.4","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"398263bd9a376651ed6fc8bd4722b799bd7def7d","_id":"easy-websocket@0.0.4","_shasum":"759bf3f80b6600bc2598ead60349c5dce68cd42b","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"759bf3f80b6600bc2598ead60349c5dce68cd42b","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.4.tgz","integrity":"sha512-AqNhfP9ZVzGf+J1OjXLT+sNB3dr4iD6PCmuyn2KQLn8oRpFNX15tjzyhaQ8CFqeSInqQwkwEh1qvQ8tMxFawVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfUzZGHgL7S1b22AwP5ZTreOCI+EumzKMu3J2wpG9UQAIgdLNN348ddDiYpz80jFB+Pk9RPot89nq0AXAljNBnksM="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.4.tgz_1461374452145_0.47162247146479785"}},"0.0.5":{"name":"easy-websocket","version":"0.0.5","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"a521e68b77ca612cf4cd4ca4333ad59fb5ea8788","_id":"easy-websocket@0.0.5","_shasum":"381d1a09a99c46e75d4ba4d2e0fe8f86a29080c3","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"381d1a09a99c46e75d4ba4d2e0fe8f86a29080c3","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.5.tgz","integrity":"sha512-542qeGYV69TcyT7zQwEQxL9YToPciVPJZVekRjdDr9Q+p5C/qUbmC1jJpU7RL8IWlfgUc+hqF4+NO+iVXGTh6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFeL2RIcxirJE0k72Mk2QPssDDdKVUTWivH1LJXLTOZAiB0zYrVJOsmbyNA7UXQu4HsHze639YKfDncOji/vpLvDQ=="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.5.tgz_1461378918611_0.5160320771392435"}},"0.0.6":{"name":"easy-websocket","version":"0.0.6","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"07617863bdb70a8baecb1f46f87da48c726f7891","_id":"easy-websocket@0.0.6","_shasum":"dfc28c65f9dabb45abea23b3ebc72a9ccfa47022","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"dfc28c65f9dabb45abea23b3ebc72a9ccfa47022","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.6.tgz","integrity":"sha512-SKosbpehkDMAhzkYrvSVWflTK8TpG+YinnCuGeeujBX/+eMfONE4lx8iNHFY0IZMJkT/Mf/+OjIb1ph0noDAgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG44wM3adZtOc7pqsuYczpr04HPp2TUiwLqlHORpNNWOAiBpjOcMa8d1qr0gFg7lor9NG92XOEJOK282OJ8TdI6uXQ=="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.6.tgz_1461383356385_0.06888055894523859"}},"0.0.7":{"name":"easy-websocket","version":"0.0.7","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"17f70111dd129f9bb8f2bd582c6fdb7c605a390e","_id":"easy-websocket@0.0.7","_shasum":"4749491903daac7a8fe0fdc9533806677600e0e1","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"4749491903daac7a8fe0fdc9533806677600e0e1","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.7.tgz","integrity":"sha512-K1gGk5dxv01TyJi+sFCtuqajh/vbbS1OtYVe/CpaL2SFfc5qJIjuIRVfU1F3Y8qhI/Xp1WJGksMmIU4mwuQJBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAiKmM/2tAN+0xGHE1jLtfxqPmi7hkyB4lIUBE5fXmPAIgcbxEo83hsB2isfOxEuVvWt3hCWDAWN6ujCN4XP+FK8w="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.7.tgz_1461420728129_0.3078668562229723"}},"0.0.8":{"name":"easy-websocket","version":"0.0.8","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"b25d998d8741310849e568c47db34d9be4a32b0e","_id":"easy-websocket@0.0.8","_shasum":"1ed7bebf667a9b56ec9a9dd9d84d52d6e762c399","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"1ed7bebf667a9b56ec9a9dd9d84d52d6e762c399","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.8.tgz","integrity":"sha512-pn6h4Mjp0yPwff2BGl2jhDE86vrD7vlWBDVDKvNBl16Uz/bd+utR91ajjtL9rf+SaMOTQDWxQ4wqUUdxeJYgqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI0ZhopPpG04ZLApZx6adxBvVBf4YeCBNVUhWW30fp3gIgAImQu4uICZB4dK3RjR6ibrz100947BXjkO5joooFrkM="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.8.tgz_1461463357434_0.5525548737496138"}},"0.0.9":{"name":"easy-websocket","version":"0.0.9","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"c6df84824e6fd83b00449536f4b66b019886c07c","_id":"easy-websocket@0.0.9","_shasum":"3e187f45c78aa0bbe94689e55d37ab4dd233d718","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"3e187f45c78aa0bbe94689e55d37ab4dd233d718","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.0.9.tgz","integrity":"sha512-YYuhOGlQEVRAcsdTQfsr/JEi909iL2dvC0yliCL5iBgK3v6C7n2UklquvqMM08grcVAFV20VkibNP3DtDSC77A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3EnYfEWwqy4AafU2KxptzsvSFTt+9jhdSKjrhAZxVaAiAffn++KIbcCDZBs11XEGhKsfxIBSeuNsjiD1pFCkf0jg=="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.0.9.tgz_1468073412636_0.9982526218518615"}},"0.1.0":{"name":"easy-websocket","version":"0.1.0","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"155a8fa07b4cf296afab873c181d502a223567bf","_id":"easy-websocket@0.1.0","_shasum":"e38721f5c15ba678e889595b44bc356e4481b5bc","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"e38721f5c15ba678e889595b44bc356e4481b5bc","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.1.0.tgz","integrity":"sha512-IaSUnWkYBFEDg/NkUyParddUeswnbN5ejIVuxHh9ECj65BU+Z0Zei1mC2v0OwCGJivpNQy/GEFlh/G3zl57StA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXm4AugeZHRlrdvWzLyGd3v5vxCwS9791tPkwMHBM+8gIgd87t9a6Flk6Q/2/Mop3zNnxb7jbGs8I+y0JbnAhtiOE="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.1.0.tgz_1472192293825_0.5334256468340755"}},"0.1.1":{"name":"easy-websocket","version":"0.1.1","description":"easy websocket","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","gitHead":"f6e7b5c3c95891b4351d3f1e78f63ca5974faf6c","_id":"easy-websocket@0.1.1","_shasum":"dde1511412371ac2fdf539ae7ee8852800fd082f","_from":".","_npmVersion":"3.10.8","_nodeVersion":"5.8.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"dde1511412371ac2fdf539ae7ee8852800fd082f","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.1.1.tgz","integrity":"sha512-a4r0C48WssRXs34DZHj93ntI1Id0W0xgSNCsyO/fsdG1xfRGDbBoMKi0rC4R0F8Y9HhWX+IOD8iFWt4yPEzYuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGuxGpj+m9QwJnAUlnX+yzvBoeNXfrhehyan9bSzdYoHAiAQFWLhFFq/g0bjgpAx/mL1J79P2jv1Mhp0c1+TkyWKOA=="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/easy-websocket-0.1.1.tgz_1476784580128_0.6325395009480417"}},"0.1.2":{"name":"easy-websocket","version":"0.1.2","description":"easy websocket","main":"index.js","scripts":{"test":"./node_modules/ava/cli.js","test-cov":"./node_modules/nyc/bin/nyc.js --reporter=lcov npm test"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","devDependencies":{"ava":"^0.17.0","nyc":"^10.0.0"},"gitHead":"13c34dfcabe36f167e0be12bcd164024ded3b899","_id":"easy-websocket@0.1.2","_shasum":"c0d1c7121cf2d6bcae42eb5b74e68b1836886081","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"c0d1c7121cf2d6bcae42eb5b74e68b1836886081","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.1.2.tgz","integrity":"sha512-PxRu6CMwtFWAfU3djVIOemIi19/GhA1wexTioKpui9vTyr4YnChnfwnWS0yUJtIDgXL07gPQSMmmZbESkv2KZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmF8uVR/sxk/voyQB1j2yAEGb3Z4nl9zVaeVa5WpAywwIhAK6sBxCmuNwFqVm2XRHSfaFPD2z6akxwiO4kXNGg8qck"}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.1.2.tgz_1481273126101_0.6180481570772827"}},"0.2.0":{"name":"easy-websocket","version":"0.2.0","description":"easy websocket","main":"index.js","scripts":{"test":"./node_modules/ava/cli.js","test-cov":"./node_modules/nyc/bin/nyc.js --reporter=lcov npm test"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","devDependencies":{"ava":"^0.17.0","nyc":"^10.0.0"},"gitHead":"79392b4a2d22e1038af20bd334ee63a6d6c38b5b","_id":"easy-websocket@0.2.0","_shasum":"35a4cd67a5d7487ec1a3fbaf78e6997b4eab36eb","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"35a4cd67a5d7487ec1a3fbaf78e6997b4eab36eb","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.2.0.tgz","integrity":"sha512-Es9lp6ONtiIk2cDMjJXd2mmH1iSlcmcX3FdebGE66hW9kWD/jKZFBRMGL7/JZyVmYpQYGWav+iHPJdRQg8jHCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrv+AgOKWLWpoiH2ZMlE0x1SjkJatvkIxqu7le2edF5wIgaRYWZAgZ9npRBdQY/3vGs8hV7bszcQwRti15PNyuyII="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.2.0.tgz_1482426652814_0.530079985735938"}},"0.2.1":{"name":"easy-websocket","version":"0.2.1","description":"easy websocket","main":"index.js","scripts":{"test":"./node_modules/ava/cli.js","test-cov":"./node_modules/nyc/bin/nyc.js --reporter=lcov npm test"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","devDependencies":{"ava":"^0.17.0","nyc":"^10.0.0"},"gitHead":"6bade3e96797b5ffe8b1c2b3e90e43b7af9167f0","_id":"easy-websocket@0.2.1","_shasum":"9fbe8b2244af019d71a5436bd0f11283cc12ead6","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"},"dist":{"shasum":"9fbe8b2244af019d71a5436bd0f11283cc12ead6","tarball":"https://registry.npmjs.org/easy-websocket/-/easy-websocket-0.2.1.tgz","integrity":"sha512-q+HyXFWeTlB/BB2lG0wzvnLOlKl0e1VYY7OBIxGkSvYTyXWsG5D6coT2NUgDhnKOFXhNyNWnj2c4TQWstRz71w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA67DRBVSeI0BibtIjPbGjDBFQEwsIFpisFqCRguRkTQAiBy7Cmar6Ix58qAlB4ueJOLr8HZrQyXow+k6NE3J28TRw=="}]},"maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/easy-websocket-0.2.1.tgz_1484017637744_0.16880596615374088"}}},"readme":"### easy-websocket for node\n\n[![Build Status](https://travis-ci.org/vincentLiuxiang/easy-websocket.svg?branch=master)](https://travis-ci.org/vincentLiuxiang/easy-websocket) [![Coverage Status](https://coveralls.io/repos/github/vincentLiuxiang/easy-websocket/badge.svg)](https://coveralls.io/github/vincentLiuxiang/easy-websocket)\n\n(The MIT License)\n\n## install\n```\nnpm install easy-websocket\n```\n## use\n```javascripts\nvar websocket = require('easy-websocket');\n```\n\n## example \n##### browser client\n[index.html](https://github.com/vincentLiuxiang/easy-websocket/blob/master/example/index.html)\n\n```javascripts\n  ws = new WebSocket('ws://'+window.location.host+'/Demo');\n  \n  ws.onopen = function (e) {\n    console.log('onopen ...,will send ...');\n    ws.send('hello world);\n  };\n\n  ws.onclose = function (e) {\n    console.log('closed ...');\n  };\n\n  ws.onmessage = function (e) {\n    console.log('onmessage',e.data);\n  };\n\n  ws.onerror   = function (e) {\n    console.log(e);\n  };\n  \n  ...\n\n  ws.send(...);\n  ws.close(1000);\n```\n\n## server\n\n* `http` [path]/example/http-example.js\n\n```javascript\nvar http      = require('http');\nvar fs        = require('fs');\nvar websocket = require('easy-websocket');\n\nvar server = http.createServer(function (req,res) {\n  fs.readFile('./index.html',function (err,data) {\n    res.end(data)\n  })\n});\n\nwebsocket(server)\n  .on('connect',(ws) => {\n    ws.on('data',(obj) => {\n      console.log(obj.type);\n      ws.send(\"hello world\");\n    })\n  })\n\nserver.listen(3000);\n```\n\n* `express`  [path]/example/express-example.js\n* only require websocket protocol\n\n```javascript\nvar app       = require('express')();\nvar http      = require('http');\nvar fs        = require('fs');\n\n// only websocket protocal\nvar websocketlib = require('easy-websocket/websocket');\n\napp.use(function (req,res,next) {\n  fs.readFile('./index.html',function (err,data) {\n    res.end(data);\n  })\n});\n\nvar server = http.Server(app);\n\n// websocket\nserver.on('upgrade',function (req,socket,head) {\n  var ws = websocketlib(socket)\n    .shakeHand(req)\n    .receiveFrame()\n    .on('data',(obj) => {\n      console.log(obj.type,obj.buffer.length);\n      switch(obj.type) {\n        case 'string':\n          ws.send(obj.buffer.toString());\n        break;\n        case 'binary':\n          ws.send(obj.buffer,'binary');\n        break;\n      }\n    })\n})\n\nserver.listen(3000);\n```\n## Check auth \n\n\nWhen the client tries to connect to the websocket server, the easy-websocket checks auth before the server responds with handshake data, and then decides whether  responds with handshake data.\n\nBy default,\n\n* if defaultAuth(req) returns a false,  server responds with shakehand data.\n* if defaultAuth(req) returns a non-false value,  server will end the socket with the value, and reject the shakehand request.\n\n```javascript\nWebSocket.prototype.defaultAuth = function (req) {\n  if (!req.headers.origin) {\n    return 'origin header is not exist';\n  }\n\n  if (!req.headers.host) {\n    return 'host header is not exist';\n  }\n\n  var host = urlParse(req.headers.origin).host;\n\n  if (host !== req.headers.host) {\n    return 'Origin: ' + req.headers.origin + ' 403 forbidden\\n'\n  }\n\n  return false\n}\n```\n\n\n## Check auth in your way \n\neasy-websocket provides a custom way to check auth.\n\n* By default, auth is undefined. So easy-websocket checks auth via defaultAuth(req);\n* However, if you set auth, easy-websocket checks auth via auth(req);\n\n* when calls this.auth(req), and it returns a false (or can be converted to false), server will respond with shakehand data.\n* when calls this.auth(req), and it returns a non-false value. server will end the socket with the value, and reject the shakehand request.\n\neg.\n\n```javascript\nvar app       = require('connect')();\nvar http      = require('http');\nvar fs        = require('fs');\nvar server    = http.Server(app);\nvar websocket = require('easy-websocket');\nvar wsServer  = websocket(server);\napp.use(function (req,res,next) {\n  fs.readFile('./index.html',function (err,data) {\n    res.end(data);\n  })\n});\n\n// check auth\nwsServer.auth = function (req) {\n  return checkCookie(req);\n}\n\nfunction checkCookie(req) {\n  // return '403 forbidden';\n  return false;\n}\n\nwsServer.on('connect',(ws) => {\n  ws.on('data',(obj) => {\n    console.log(obj.type,obj.buffer.length);\n    ws.send('hello world');\n  });\n})\n\n\n\nvar server = http.Server(app).listen(3000);\n```\n\n\n## api\n\n### 1 websocket.js: protocol\n\n```\nvar websocketlib = require('easy-websocket/websocket');\n```\n\n#### 1.1  websocketlib(socket[,config]);\n\nsocket: instance of net.Socket;\n\n```javascript\nvar websocketlib = require('easy-websocket/websocket');\nserver.on('upgrade',function (req,socket,head) {\n\n  // check req auth\n  // ...\n  \n  var ws = websocketlib(socket)\n    .shakeHand(req)\n    .receiveFrame()\n    .on('data',function(obj){\n      console.log(obj.type,obj.buffer.length);\n      switch(obj.type) {\n        case 'string':\n          ws.send(obj.buffer.toString());\n        break;\n        case 'binary':\n          ws.send(obj.buffer,'binary');\n        break;\n      }\n    });\n})\n```\nconfig: optional , json object;\ndefalut config:\n\n```javascript\n{\n  pingInterval:10000,\n  enablePing:true,\n  enablePong:true\n}\n```\n#### 1.2, defaultAuth(req)\n\ndefault check auth method;\n\n#### 1.3, auth(req)\n\nan interface to user, if auth is set, check auth via auth(req);\n\n#### 1.4, shakeHand(req);\n\nreq: http request from client;\n\n#### 1.5, receiveFrame();\nreceive Frame from client;\n\n#### 1.6, startPing();\ncreate a ping frame from server to client. By default , this function will call ping([data]) every 10s to ensure this socket connection is alive;\n\nif config.enablePing is true and you never call clearPing() ,it means you should not call this function;\n\n#### 1.7, clearPing();\nstop ping ;\n\n#### 1.8, ping([data]);\nonly create ping frame one time;\ndata: optinal, it can be a string or buffers\n\n#### 1.9, pong([data]);\nrespone for ping which come from client;\n\n#### 1.10, send(data[,opcode]);\ndata : a string or buffers\nopcode : optinal, the default value is 'text'. if data are buffers , this value must set 'binary'\n\n#### 1.11, end();\nclose socket;\n\n#### event \n* 'connect' emit when shakehand success\n* 'data' : emit when receive data from client\n* 'error' : emit when some error occur\n* 'ping' : emit when server accept ping frame\n* 'pong' : emit when server accept pong frame\n* 'close' : emit when close socket\n\n\n\n\n### index.js: websocket server\n\n```javascript\nvar websocket = require('easy-websocket');\n...\nvar wsServer  = websocket(server,{...});\nwsServer.on('connect',(ws) => {\n  ws.on('data',(obj) => {\n    console.log(obj.type,obj.buffer.length);\n    ws.send('hello world');\n  });\n})\n```\n\n\n\n#### 2.1, websocket(server[,config]);\n\nserver instance of http.Server;\n\nconfig refer to 1.1\n\n\n\n#### 2.2, auth(req);\n\nAn interface to user, wesocketlib.auth will reference to this auth, if we set this auth, when calls auth(req) in wesocketlib,  it actually calls this auth. \n\n```javascript\n// check auth\nwsServer.auth = function (req) {\n  return checkCookie(req);\n}\n```\n\n\n\n#### event\n\n* connect: emit when shakehand success. The only input param of callback `ws`is an instance of  websocketlib\n\n  ```javascript\n  wsServer.on('connect',(ws) => {\n    ws.on('data',(obj) => {\n      console.log(obj.type,obj.buffer.length);\n      ws.send('hello world');\n    });\n  })\n  ```\n\n  ​\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","maintainers":[{"name":"liuxiang","email":"hitliuyaguang@foxmail.com"}],"time":{"modified":"2022-06-16T03:57:24.339Z","created":"2016-04-22T08:45:04.387Z","0.0.1":"2016-04-22T08:45:04.387Z","0.0.2":"2016-04-22T09:24:18.146Z","0.0.3":"2016-04-23T01:06:44.826Z","0.0.4":"2016-04-23T01:20:52.731Z","0.0.5":"2016-04-23T02:35:21.810Z","0.0.6":"2016-04-23T03:49:16.873Z","0.0.7":"2016-04-23T14:12:08.616Z","0.0.8":"2016-04-24T02:02:37.934Z","0.0.9":"2016-07-09T14:10:15.145Z","0.1.0":"2016-08-26T06:18:15.563Z","0.1.1":"2016-10-18T09:56:22.285Z","0.1.2":"2016-12-09T08:45:27.877Z","0.2.0":"2016-12-22T17:10:53.037Z","0.2.1":"2017-01-10T03:07:17.987Z"},"keywords":["websocket","easy-websocket","easywebsocket"],"author":{"name":"liuxiang"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/vincentLiuxiang/easy-websocket#readme","repository":{"type":"git","url":"git+https://github.com/vincentLiuxiang/easy-websocket.git"},"bugs":{"url":"https://github.com/vincentLiuxiang/easy-websocket/issues"},"users":{}}