{"_id":"websocket-driver","_rev":"100992","name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","dist-tags":{"latest":"0.7.4"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"time":{"modified":"2021-06-03T10:35:03.000Z","created":"2013-05-04T19:42:46.505Z","0.7.4":"2020-05-22T15:02:19.046Z","0.7.3":"2019-06-13T15:41:39.923Z","0.7.1":"2019-06-10T11:24:18.915Z","0.7.0":"2017-09-11T20:54:17.920Z","0.6.5":"2016-05-20T07:41:14.593Z","0.6.4":"2016-01-07T08:58:34.783Z","0.6.3":"2015-11-06T22:17:25.225Z","0.6.2":"2015-07-18T16:48:39.984Z","0.6.1":"2015-07-13T19:24:51.453Z","0.6.0":"2015-07-08T20:02:22.490Z","0.5.4":"2015-03-29T22:13:46.951Z","0.5.3":"2015-02-22T21:14:08.632Z","0.5.2":"2015-02-19T09:51:28.802Z","0.5.1":"2014-12-18T02:24:20.881Z","0.5.0":"2014-12-13T13:11:19.014Z","0.4.0":"2014-11-08T19:47:11.581Z","0.3.6":"2014-10-04T07:32:33.399Z","0.3.5":"2014-07-06T09:20:17.409Z","0.3.4":"2014-05-08T01:19:47.964Z","0.3.3":"2014-04-24T22:33:58.247Z","0.3.2":"2013-12-29T12:25:51.236Z","0.3.1":"2013-12-03T00:47:11.161Z","0.3.0":"2013-09-09T21:17:15.895Z","0.2.2":"2013-07-05T14:17:43.729Z","0.2.1":"2013-05-17T10:52:13.231Z","0.2.0":"2013-05-12T14:20:55.284Z","0.1.0":"2013-05-04T19:42:46.505Z"},"users":{"brianloveswords":true,"asilvas":true,"hollobit":true,"huangjia86":true,"staydan":true,"jimknopf":true},"author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"versions":{"0.7.4":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"https://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"Apache-2.0","version":"0.7.4","engines":{"node":">=0.8.0"},"main":"./lib/websocket/driver","dependencies":{"http-parser-js":">=0.5.1","safe-buffer":">=5.1.0","websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"*","permessage-deflate":"*"},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"gitHead":"5f711f089234a46f8d1e50054115ea169257eaa4","_id":"websocket-driver@0.7.4","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"shasum":"89ad5295bbf64b480abcba31e4953aca706f5760","size":19196,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.7.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.7.4.tgz"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/websocket-driver_0.7.4_1590159738877_0.13982233289170365"},"_hasShrinkwrap":false,"publish_time":1590159739046,"_cnpm_publish_time":1590159739046},"0.7.3":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"https://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"Apache-2.0","version":"0.7.3","engines":{"node":">=0.8.0"},"main":"./lib/websocket/driver","dependencies":{"http-parser-js":">=0.4.0 <0.4.11","safe-buffer":">=5.1.0","websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"*","permessage-deflate":"*"},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"gitHead":"03aebd19fb2b5f8fece4fff054ea034a54640ff3","_id":"websocket-driver@0.7.3","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"shasum":"a2d4e0d4f4f116f1e6297eba58b05d430100e9f9","size":19178,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.7.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.7.3.tgz"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/websocket-driver_0.7.3_1560440499731_0.8651938304954445"},"_hasShrinkwrap":false,"publish_time":1560440499923,"_cnpm_publish_time":1560440499923},"0.7.1":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"https://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"Apache-2.0","version":"0.7.1","engines":{"node":">=0.8.0"},"main":"./lib/websocket/driver","dependencies":{"http-parser-js":">=0.4.0","safe-buffer":">=5.1.1","websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"*","permessage-deflate":"*"},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"gitHead":"b5ac8564438b21faaac12b8b62897ced90e1c176","_id":"websocket-driver@0.7.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"shasum":"d58fa3269f51e480f5af051db7f5c5c1a1092d20","size":19024,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.7.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.7.1.tgz"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/websocket-driver_0.7.1_1560165858709_0.33665151907526014"},"_hasShrinkwrap":false,"publish_time":1560165858915,"_cnpm_publish_time":1560165858915},"0.7.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"https://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.7.0","engines":{"node":">=0.8.0"},"files":["lib"],"main":"./lib/websocket/driver","dependencies":{"http-parser-js":">=0.4.0","websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"*","permessage-deflate":"*"},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"gitHead":"8128bec1e03c4eeb3c3bdb250a4356a4c69fe10f","_id":"websocket-driver@0.7.0","_shasum":"0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"dist":{"shasum":"0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb","size":18928,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.7.0.tgz"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/websocket-driver-0.7.0.tgz_1505163256798_0.4708031218033284"},"directories":{},"publish_time":1505163257920,"_cnpm_publish_time":1505163257920,"_hasShrinkwrap":false},"0.6.5":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"https://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.6.5","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"gitHead":"c4494ff88ac196f726bbb77a301c2177124b199e","_id":"websocket-driver@0.6.5","_shasum":"5cb2556ceb85f4373c6d8238aa691c8454e13a36","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"5cb2556ceb85f4373c6d8238aa691c8454e13a36","size":18361,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.6.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.6.5.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/websocket-driver-0.6.5.tgz_1463730072239_0.9899731166660786"},"directories":{},"publish_time":1463730074593,"_cnpm_publish_time":1463730074593,"_hasShrinkwrap":false},"0.6.4":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"https://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.6.4","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"gitHead":"2be829546b462aa7d552214e17d6f3e42b6a4bd0","_id":"websocket-driver@0.6.4","_shasum":"65b84d02113480d3fc05e63e809322042bdc940b","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"65b84d02113480d3fc05e63e809322042bdc940b","size":18384,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.6.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.6.4.tgz"},"directories":{},"publish_time":1452157114783,"_cnpm_publish_time":1452157114783,"_hasShrinkwrap":false},"0.6.3":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.6.3","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"10481b81dbf80f83dbacffd8439405ba0a90e477","_id":"websocket-driver@0.6.3","_shasum":"fd21911bb46dee34ad85bdbc5676bf9024ed087b","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"fd21911bb46dee34ad85bdbc5676bf9024ed087b","size":18194,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.6.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.6.3.tgz"},"directories":{},"publish_time":1446848245225,"_cnpm_publish_time":1446848245225,"_hasShrinkwrap":false},"0.6.2":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.6.2","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"fa8b82d424bddef1eba51e725ddc6a48965fd605","_id":"websocket-driver@0.6.2","_shasum":"8281dba3e299e5bd7a42b65d4577a8928c26f898","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"8281dba3e299e5bd7a42b65d4577a8928c26f898","size":18045,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.6.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.6.2.tgz"},"directories":{},"publish_time":1437238119984,"_cnpm_publish_time":1437238119984,"_hasShrinkwrap":false},"0.6.1":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.6.1","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"c84cce9a1f9e4273d8c39a4533963b4eb8fd459b","_id":"websocket-driver@0.6.1","_shasum":"8b86f082e48f306f597e98e60092810501f09725","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"8b86f082e48f306f597e98e60092810501f09725","size":17992,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.6.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.6.1.tgz"},"directories":{},"publish_time":1436815491453,"_cnpm_publish_time":1436815491453,"_hasShrinkwrap":false},"0.6.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.6.0","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"7a1cb15b8c20d7e225172e7631133fd84c505b5f","_id":"websocket-driver@0.6.0","_shasum":"0d9e0e0ea66e392f0c613c535d806e076b42ff5d","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.6","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"0d9e0e0ea66e392f0c613c535d806e076b42ff5d","size":18080,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.6.0.tgz"},"directories":{},"publish_time":1436385742490,"_cnpm_publish_time":1436385742490,"_hasShrinkwrap":false},"0.5.4":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.5.4","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"1cc0f33e1c82d9ed93ba8fa40b4bbd2dd9368d9c","_id":"websocket-driver@0.5.4","_shasum":"4c65278c92929384eacfcd908d3e9e0a5691c29e","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.1","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"4c65278c92929384eacfcd908d3e9e0a5691c29e","size":17798,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.5.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.5.4.tgz"},"directories":{},"publish_time":1427667226951,"_cnpm_publish_time":1427667226951,"_hasShrinkwrap":false},"0.5.3":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.5.3","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"2b99c23788a2341baf5aaa23f2cf2c044d109cc5","_id":"websocket-driver@0.5.3","_shasum":"775d079018f8985e1c255eb8efa9224895acacc3","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"775d079018f8985e1c255eb8efa9224895acacc3","size":17735,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.5.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.5.3.tgz"},"directories":{},"publish_time":1424639648632,"_cnpm_publish_time":1424639648632,"_hasShrinkwrap":false},"0.5.2":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.5.2","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.1"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"0b7eedc3b55db9cbd8a482a009c229380201da97","_id":"websocket-driver@0.5.2","_shasum":"8c7c85da0713b4060556b4d71c01775ee1269eb9","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"8c7c85da0713b4060556b4d71c01775ee1269eb9","size":17691,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.5.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.5.2.tgz"},"directories":{},"publish_time":1424339488802,"_cnpm_publish_time":1424339488802,"_hasShrinkwrap":false},"0.5.1":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.5.1","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.0"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"57e74231cf24e63b902347a8a5d5836247762559","_id":"websocket-driver@0.5.1","_shasum":"dd954c0a42a9962a31296f84cc465ca4b74c2611","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"dd954c0a42a9962a31296f84cc465ca4b74c2611","size":17414,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.5.1.tgz"},"directories":{},"publish_time":1418869460881,"_cnpm_publish_time":1418869460881,"_hasShrinkwrap":false},"0.5.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.5.0","engines":{"node":">=0.6.0"},"main":"./lib/websocket/driver","dependencies":{"websocket-extensions":">=0.1.0"},"devDependencies":{"jstest":"","permessage-deflate":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"e8992add2335f8bec677c59273b3f32d6925097a","_id":"websocket-driver@0.5.0","_shasum":"7dc0d0c2d77975d55494ff85e67400841887aca1","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"7dc0d0c2d77975d55494ff85e67400841887aca1","size":17267,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.5.0.tgz"},"directories":{},"publish_time":1418476279014,"_cnpm_publish_time":1418476279014,"_hasShrinkwrap":false},"0.4.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.4.0","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"22d483a5ee76f7f4b16e92b8500c0b7706b5b3dc","_id":"websocket-driver@0.4.0","_shasum":"71fa992e5d41c2cc5e290420687d0601efd06b7a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"71fa992e5d41c2cc5e290420687d0601efd06b7a","size":16315,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.4.0.tgz"},"directories":{},"publish_time":1415476031581,"_cnpm_publish_time":1415476031581,"_hasShrinkwrap":false},"0.3.6":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.6","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"1c33c0ce5698c43e24e043b647fa6a965b075d60","_id":"websocket-driver@0.3.6","_shasum":"85d03e26be0b820b4466a78bbf36a6596bc2aa75","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"85d03e26be0b820b4466a78bbf36a6596bc2aa75","size":15259,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.6.tgz"},"directories":{},"publish_time":1412407953399,"_cnpm_publish_time":1412407953399,"_hasShrinkwrap":false},"0.3.5":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.5","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"gitHead":"dbedb370b791a6af9ca5dcb939123552cdd88990","_id":"websocket-driver@0.3.5","_shasum":"e3a51ff538f1653a49e62d78ecfc1eb1bde9e5a0","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"e3a51ff538f1653a49e62d78ecfc1eb1bde9e5a0","size":15195,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.5.tgz"},"directories":{},"publish_time":1404638417409,"_cnpm_publish_time":1404638417409,"_hasShrinkwrap":false},"0.3.4":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.4","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"_id":"websocket-driver@0.3.4","_shasum":"f37ab303f6a602c4b0dbcaa1cdd771e442b04ea7","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"dist":{"shasum":"f37ab303f6a602c4b0dbcaa1cdd771e442b04ea7","size":15211,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.4.tgz"},"directories":{},"publish_time":1399511987964,"_cnpm_publish_time":1399511987964,"_hasShrinkwrap":false},"0.3.3":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.3","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"_id":"websocket-driver@0.3.3","dist":{"shasum":"11a8986d26bd81a684048a21b18c0f2ef292ef06","size":15175,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1398378838247,"_cnpm_publish_time":1398378838247,"_hasShrinkwrap":false},"0.3.2":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.2","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"readmeFilename":"README.md","_id":"websocket-driver@0.3.2","dist":{"shasum":"f177ef6611390e2401ae47f35e8386dda987daca","size":15138,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.2.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1388319951236,"_hasShrinkwrap":false,"_cnpm_publish_time":1388319951236},"0.3.1":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.1","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"readmeFilename":"README.md","_id":"websocket-driver@0.3.1","dist":{"shasum":"25f86b4e7ca9d8f8136cd225ffcee71a3d2869cf","size":14959,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1386031631161,"_hasShrinkwrap":false,"_cnpm_publish_time":1386031631161},"0.3.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.3.0","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"readmeFilename":"README.md","_id":"websocket-driver@0.3.0","dist":{"shasum":"497b258c508b987249ab9b6f79f0c21dd3467c64","size":14389,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.3.0.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1378761435895,"_hasShrinkwrap":false,"_cnpm_publish_time":1378761435895},"0.2.2":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"license":"MIT","version":"0.2.2","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jstest":""},"scripts":{"test":"jstest spec/runner.js"},"repository":{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"},"bugs":{"url":"http://github.com/faye/websocket-driver-node/issues"},"readmeFilename":"README.md","_id":"websocket-driver@0.2.2","dist":{"shasum":"998bc1855d8cd0d1e9aa8f8056b83b46ac3e81ef","size":14337,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.2.2.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1373033863729,"_hasShrinkwrap":false,"_cnpm_publish_time":1373033863729},"0.2.1":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"version":"0.2.1","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jsclass":""},"scripts":{"test":"node spec/runner.js"},"bugs":"http://github.com/faye/websocket-driver-node/issues","licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"repositories":[{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"}],"readmeFilename":"README.md","_id":"websocket-driver@0.2.1","dist":{"shasum":"666622a997665e21268a89b30c05b7b739e9afa7","size":14333,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.2.1.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1368787933231,"_hasShrinkwrap":false,"_cnpm_publish_time":1368787933231},"0.2.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"version":"0.2.0","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jsclass":""},"scripts":{"test":"node spec/runner.js"},"bugs":"http://github.com/faye/websocket-driver-node/issues","licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"repositories":[{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"}],"readmeFilename":"README.md","_id":"websocket-driver@0.2.0","dist":{"shasum":"d344ae28f46b411d0ecb5088f10bec6ace721920","size":14254,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.2.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1368368455284,"_hasShrinkwrap":false,"_cnpm_publish_time":1368368455284},"0.1.0":{"name":"websocket-driver","description":"WebSocket protocol handler with pluggable I/O","homepage":"http://github.com/faye/websocket-driver-node","author":{"name":"James Coglan","email":"jcoglan@gmail.com","url":"http://jcoglan.com/"},"keywords":["websocket"],"version":"0.1.0","engines":{"node":">=0.4.0"},"main":"./lib/websocket/driver","devDependencies":{"jsclass":""},"scripts":{"test":"node spec/runner.js"},"bugs":"http://github.com/faye/websocket-driver-node/issues","licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"repositories":[{"type":"git","url":"git://github.com/faye/websocket-driver-node.git"}],"readmeFilename":"README.md","_id":"websocket-driver@0.1.0","dist":{"shasum":"14bdc1f671d8df4311cd29b92162786b396e893e","size":12300,"noattachment":false,"key":"/websocket-driver/-/websocket-driver-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/websocket-driver/download/websocket-driver-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jcoglan","email":"jcoglan@gmail.com"},"maintainers":[{"name":"jcoglan","email":"jcoglan@gmail.com"}],"directories":{},"publish_time":1367696566505,"_hasShrinkwrap":false,"_cnpm_publish_time":1367696566505}},"readme":"# websocket-driver [![Build Status](https://travis-ci.org/faye/websocket-driver-node.svg)](https://travis-ci.org/faye/websocket-driver-node)\n\nThis module provides a complete implementation of the WebSocket protocols that\ncan be hooked up to any I/O stream. It aims to simplify things by decoupling the\nprotocol details from the I/O layer, such that users only need to implement code\nto stream data in and out of it without needing to know anything about how the\nprotocol actually works. Think of it as a complete WebSocket system with\npluggable I/O.\n\nDue to this design, you get a lot of things for free. In particular, if you hook\nthis module up to some I/O object, it will do all of this for you:\n\n- Select the correct server-side driver to talk to the client\n- Generate and send both server- and client-side handshakes\n- Recognize when the handshake phase completes and the WS protocol begins\n- Negotiate subprotocol selection based on `Sec-WebSocket-Protocol`\n- Negotiate and use extensions via the\n  [websocket-extensions](https://github.com/faye/websocket-extensions-node)\n  module\n- Buffer sent messages until the handshake process is finished\n- Deal with proxies that defer delivery of the draft-76 handshake body\n- Notify you when the socket is open and closed and when messages arrive\n- Recombine fragmented messages\n- Dispatch text, binary, ping, pong and close frames\n- Manage the socket-closing handshake process\n- Automatically reply to ping frames with a matching pong\n- Apply masking to messages sent by the client\n\nThis library was originally extracted from the [Faye](http://faye.jcoglan.com)\nproject but now aims to provide simple WebSocket support for any Node-based\nproject.\n\n\n## Installation\n\n```\n$ npm install websocket-driver\n```\n\n\n## Usage\n\nThis module provides protocol drivers that have the same interface on the server\nand on the client. A WebSocket driver is an object with two duplex streams\nattached; one for incoming/outgoing messages and one for managing the wire\nprotocol over an I/O stream. The full API is described below.\n\n\n### Server-side with HTTP\n\nA Node webserver emits a special event for 'upgrade' requests, and this is where\nyou should handle WebSockets. You first check whether the request is a\nWebSocket, and if so you can create a driver and attach the request's I/O stream\nto it.\n\n```js\nvar http = require('http'),\n    websocket = require('websocket-driver');\n\nvar server = http.createServer();\n\nserver.on('upgrade', function(request, socket, body) {\n  if (!websocket.isWebSocket(request)) return;\n\n  var driver = websocket.http(request);\n\n  driver.io.write(body);\n  socket.pipe(driver.io).pipe(socket);\n\n  driver.messages.on('data', function(message) {\n    console.log('Got a message', message);\n  });\n\n  driver.start();\n});\n```\n\nNote the line `driver.io.write(body)` - you must pass the `body` buffer to the\nsocket driver in order to make certain versions of the protocol work.\n\n\n### Server-side with TCP\n\nYou can also handle WebSocket connections in a bare TCP server, if you're not\nusing an HTTP server and don't want to implement HTTP parsing yourself.\n\nThe driver will emit a `connect` event when a request is received, and at this\npoint you can detect whether it's a WebSocket and handle it as such. Here's an\nexample using the Node `net` module:\n\n```js\nvar net = require('net'),\n    websocket = require('websocket-driver');\n\nvar server = net.createServer(function(connection) {\n  var driver = websocket.server();\n\n  driver.on('connect', function() {\n    if (websocket.isWebSocket(driver)) {\n      driver.start();\n    } else {\n      // handle other HTTP requests\n    }\n  });\n\n  driver.on('close', function() { connection.end() });\n  connection.on('error', function() {});\n\n  connection.pipe(driver.io).pipe(connection);\n\n  driver.messages.pipe(driver.messages);\n});\n\nserver.listen(4180);\n```\n\nIn the `connect` event, the driver gains several properties to describe the\nrequest, similar to a Node request object, such as `method`, `url` and\n`headers`. However you should remember it's not a real request object; you\ncannot write data to it, it only tells you what request data we parsed from the\ninput.\n\nIf the request has a body, it will be in the `driver.body` buffer, but only as\nmuch of the body as has been piped into the driver when the `connect` event\nfires.\n\n\n### Client-side\n\nSimilarly, to implement a WebSocket client you just need to make a driver by\npassing in a URL. After this you use the driver API as described below to\nprocess incoming data and send outgoing data.\n\n\n```js\nvar net = require('net'),\n    websocket = require('websocket-driver');\n\nvar driver = websocket.client('ws://www.example.com/socket'),\n    tcp = net.connect(80, 'www.example.com');\n\ntcp.pipe(driver.io).pipe(tcp);\n\ntcp.on('connect', function() {\n  driver.start();\n});\n\ndriver.messages.on('data', function(message) {\n  console.log('Got a message', message);\n});\n```\n\nClient drivers have two additional properties for reading the HTTP data that was\nsent back by the server:\n\n- `driver.statusCode` - the integer value of the HTTP status code\n- `driver.headers` - an object containing the response headers\n\n\n### HTTP Proxies\n\nThe client driver supports connections via HTTP proxies using the `CONNECT`\nmethod. Instead of sending the WebSocket handshake immediately, it will send a\n`CONNECT` request, wait for a `200` response, and then proceed as normal.\n\nTo use this feature, call `driver.proxy(url)` where `url` is the origin of the\nproxy, including a username and password if required. This produces a duplex\nstream that you should pipe in and out of your TCP connection to the proxy\nserver. When the proxy emits `connect`, you can then pipe `driver.io` to your\nTCP stream and call `driver.start()`.\n\n```js\nvar net = require('net'),\n    websocket = require('websocket-driver');\n\nvar driver = websocket.client('ws://www.example.com/socket'),\n    proxy  = driver.proxy('http://username:password@proxy.example.com'),\n    tcp    = net.connect(80, 'proxy.example.com');\n\ntcp.pipe(proxy).pipe(tcp, { end: false });\n\ntcp.on('connect', function() {\n  proxy.start();\n});\n\nproxy.on('connect', function() {\n  driver.io.pipe(tcp).pipe(driver.io);\n  driver.start();\n});\n\ndriver.messages.on('data', function(message) {\n  console.log('Got a message', message);\n});\n```\n\nThe proxy's `connect` event is also where you should perform a TLS handshake on\nyour TCP stream, if you are connecting to a `wss:` endpoint.\n\nIn the event that proxy connection fails, `proxy` will emit an `error`. You can\ninspect the proxy's response via `proxy.statusCode` and `proxy.headers`.\n\n```js\nproxy.on('error', function(error) {\n  console.error(error.message);\n  console.log(proxy.statusCode);\n  console.log(proxy.headers);\n});\n```\n\nBefore calling `proxy.start()` you can set custom headers using\n`proxy.setHeader()`:\n\n```js\nproxy.setHeader('User-Agent', 'node');\nproxy.start();\n```\n\n\n### Driver API\n\nDrivers are created using one of the following methods:\n\n```js\ndriver = websocket.http(request, options)\ndriver = websocket.server(options)\ndriver = websocket.client(url, options)\n```\n\nThe `http` method returns a driver chosen using the headers from a Node HTTP\nrequest object. The `server` method returns a driver that will parse an HTTP\nrequest and then decide which driver to use for it using the `http` method. The\n`client` method always returns a driver for the RFC version of the protocol with\nmasking enabled on outgoing frames.\n\nThe `options` argument is optional, and is an object. It may contain the\nfollowing fields:\n\n- `maxLength` - the maximum allowed size of incoming message frames, in bytes.\n  The default value is `2^26 - 1`, or 1 byte short of 64 MiB.\n- `protocols` - an array of strings representing acceptable subprotocols for use\n  over the socket. The driver will negotiate one of these to use via the\n  `Sec-WebSocket-Protocol` header if supported by the other peer.\n\nA driver has two duplex streams attached to it:\n\n- **`driver.io`** - this stream should be attached to an I/O socket like a TCP\n  stream. Pipe incoming TCP chunks to this stream for them to be parsed, and\n  pipe this stream back into TCP to send outgoing frames.\n- **`driver.messages`** - this stream emits messages received over the\n  WebSocket.  Writing to it sends messages to the other peer by emitting frames\n  via the `driver.io` stream.\n\nAll drivers respond to the following API methods, but some of them are no-ops\ndepending on whether the client supports the behaviour.\n\nNote that most of these methods are commands: if they produce data that should\nbe sent over the socket, they will give this to you by emitting `data` events on\nthe `driver.io` stream.\n\n#### `driver.on('open', function(event) {})`\n\nAdds a callback to execute when the socket becomes open.\n\n#### `driver.on('message', function(event) {})`\n\nAdds a callback to execute when a message is received. `event` will have a\n`data` attribute containing either a string in the case of a text message or a\n`Buffer` in the case of a binary message.\n\nYou can also listen for messages using the `driver.messages.on('data')` event,\nwhich emits strings for text messages and buffers for binary messages.\n\n#### `driver.on('error', function(event) {})`\n\nAdds a callback to execute when a protocol error occurs due to the other peer\nsending an invalid byte sequence. `event` will have a `message` attribute\ndescribing the error.\n\n#### `driver.on('close', function(event) {})`\n\nAdds a callback to execute when the socket becomes closed. The `event` object\nhas `code` and `reason` attributes.\n\n#### `driver.on('ping', function(event) {})`\n\nAdds a callback block to execute when a ping is received. You do not need to\nhandle this by sending a pong frame yourself; the driver handles this for you.\n\n#### `driver.on('pong', function(event) {})`\n\nAdds a callback block to execute when a pong is received. If this was in\nresponse to a ping you sent, you can also handle this event via the\n`driver.ping(message, function() { ... })` callback.\n\n#### `driver.addExtension(extension)`\n\nRegisters a protocol extension whose operation will be negotiated via the\n`Sec-WebSocket-Extensions` header. `extension` is any extension compatible with\nthe [websocket-extensions](https://github.com/faye/websocket-extensions-node)\nframework.\n\n#### `driver.setHeader(name, value)`\n\nSets a custom header to be sent as part of the handshake response, either from\nthe server or from the client. Must be called before `start()`, since this is\nwhen the headers are serialized and sent.\n\n#### `driver.start()`\n\nInitiates the protocol by sending the handshake - either the response for a\nserver-side driver or the request for a client-side one. This should be the\nfirst method you invoke.  Returns `true` if and only if a handshake was sent.\n\n#### `driver.parse(string)`\n\nTakes a string and parses it, potentially resulting in message events being\nemitted (see `on('message')` above) or in data being sent to `driver.io`.  You\nshould send all data you receive via I/O to this method by piping a stream into\n`driver.io`.\n\n#### `driver.text(string)`\n\nSends a text message over the socket. If the socket handshake is not yet\ncomplete, the message will be queued until it is. Returns `true` if the message\nwas sent or queued, and `false` if the socket can no longer send messages.\n\nThis method is equivalent to `driver.messages.write(string)`.\n\n#### `driver.binary(buffer)`\n\nTakes a `Buffer` and sends it as a binary message. Will queue and return `true`\nor `false` the same way as the `text` method. It will also return `false` if the\ndriver does not support binary messages.\n\nThis method is equivalent to `driver.messages.write(buffer)`.\n\n#### `driver.ping(string = '', function() {})`\n\nSends a ping frame over the socket, queueing it if necessary. `string` and the\ncallback are both optional. If a callback is given, it will be invoked when the\nsocket receives a pong frame whose content matches `string`. Returns `false` if\nframes can no longer be sent, or if the driver does not support ping/pong.\n\n#### `driver.pong(string = '')`\n\nSends a pong frame over the socket, queueing it if necessary. `string` is\noptional. Returns `false` if frames can no longer be sent, or if the driver does\nnot support ping/pong.\n\nYou don't need to call this when a ping frame is received; pings are replied to\nautomatically by the driver. This method is for sending unsolicited pongs.\n\n#### `driver.close()`\n\nInitiates the closing handshake if the socket is still open. For drivers with no\nclosing handshake, this will result in the immediate execution of the\n`on('close')` driver. For drivers with a closing handshake, this sends a closing\nframe and `emit('close')` will execute when a response is received or a protocol\nerror occurs.\n\n#### `driver.version`\n\nReturns the WebSocket version in use as a string. Will either be `hixie-75`,\n`hixie-76` or `hybi-$version`.\n\n#### `driver.protocol`\n\nReturns a string containing the selected subprotocol, if any was agreed upon\nusing the `Sec-WebSocket-Protocol` mechanism. This value becomes available after\n`emit('open')` has fired.\n","_attachments":{},"homepage":"https://github.com/faye/websocket-driver-node","bugs":{"url":"https://github.com/faye/websocket-driver-node/issues"},"license":"Apache-2.0"}