{"_id":"http-raw","_rev":"96369","name":"http-raw","description":"expose the raw request data in an http server","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"substack","email":""}],"time":{"modified":"2021-06-03T10:32:13.000Z","created":"2012-12-14T07:20:10.056Z","2.1.0":"2013-03-19T06:25:17.843Z","2.0.1":"2013-03-19T05:17:03.794Z","2.0.0":"2013-03-19T05:12:11.248Z","1.1.0":"2012-12-17T08:54:49.123Z","1.0.0":"2012-12-17T03:11:41.297Z","0.2.0":"2012-12-15T10:24:15.522Z","0.1.0":"2012-12-15T09:18:16.928Z","0.0.3":"2012-12-15T06:52:05.058Z","0.0.2":"2012-12-15T03:09:19.006Z","0.0.1":"2012-12-15T02:45:26.766Z","0.0.0":"2012-12-14T07:20:10.056Z"},"users":{"wenbing":true,"monolithed":true},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"versions":{"2.1.0":{"name":"http-raw","version":"2.1.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{"through":"~2.2.7"},"devDependencies":{"tap":"~0.4.0","request":"~2.12.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readmeFilename":"readme.markdown","_id":"http-raw@2.1.0","dist":{"shasum":"f36efe2514fff95d384be6f46684806712b8879a","size":7512,"noattachment":false,"key":"/http-raw/-/http-raw-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-2.1.0.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1363674317843,"_cnpm_publish_time":1363674317843,"_hasShrinkwrap":false},"2.0.1":{"name":"http-raw","version":"2.0.1","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{"through":"~2.2.7"},"devDependencies":{"tap":"~0.4.0","request":"~2.12.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readmeFilename":"readme.markdown","_id":"http-raw@2.0.1","dist":{"shasum":"f1f12a2e554001855633969a1bb0b2814db028f7","size":7429,"noattachment":false,"key":"/http-raw/-/http-raw-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-2.0.1.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1363670223794,"_cnpm_publish_time":1363670223794,"_hasShrinkwrap":false},"2.0.0":{"name":"http-raw","version":"2.0.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0","request":"~2.12.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readmeFilename":"readme.markdown","_id":"http-raw@2.0.0","dist":{"shasum":"1b41702f4077cd6e4b0fc167d607e9aa0942dd10","size":7426,"noattachment":false,"key":"/http-raw/-/http-raw-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-2.0.0.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1363669931248,"_cnpm_publish_time":1363669931248,"_hasShrinkwrap":false},"1.1.0":{"name":"http-raw","version":"1.1.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0","request":"~2.12.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@1.1.0","dist":{"shasum":"9ff35039814ac4e73c3f2eae3055d63b40b117f9","size":7553,"noattachment":false,"key":"/http-raw/-/http-raw-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-1.1.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355734489123,"_cnpm_publish_time":1355734489123,"_hasShrinkwrap":false},"1.0.0":{"name":"http-raw","version":"1.0.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0","request":"~2.12.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@1.0.0","dist":{"shasum":"9caf07513fd6023ba804a532270597142dace4f8","size":7225,"noattachment":false,"key":"/http-raw/-/http-raw-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-1.0.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355713901297,"_cnpm_publish_time":1355713901297,"_hasShrinkwrap":false},"0.2.0":{"name":"http-raw","version":"0.2.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0","request":"~2.12.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@0.2.0","dist":{"shasum":"3082e58cf65ba629eb6982a0108b4f4348bf83e5","size":6716,"noattachment":false,"key":"/http-raw/-/http-raw-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-0.2.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355567055522,"_cnpm_publish_time":1355567055522,"_hasShrinkwrap":false},"0.1.0":{"name":"http-raw","version":"0.1.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@0.1.0","dist":{"shasum":"1aa419236431d28737436cb5fbf5e1b65a88d550","size":4146,"noattachment":false,"key":"/http-raw/-/http-raw-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-0.1.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355563096928,"_cnpm_publish_time":1355563096928,"_hasShrinkwrap":false},"0.0.3":{"name":"http-raw","version":"0.0.3","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@0.0.3","dist":{"shasum":"0e16b3395486345892b71eb45229295869385680","size":3909,"noattachment":false,"key":"/http-raw/-/http-raw-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-0.0.3.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355554325058,"_cnpm_publish_time":1355554325058,"_hasShrinkwrap":false},"0.0.2":{"name":"http-raw","version":"0.0.2","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@0.0.2","dist":{"shasum":"35109da445a032fafb632296d3150f47afa9bd42","size":3902,"noattachment":false,"key":"/http-raw/-/http-raw-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-0.0.2.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355540959006,"_cnpm_publish_time":1355540959006,"_hasShrinkwrap":false},"0.0.1":{"name":"http-raw","version":"0.0.1","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@0.0.1","dist":{"shasum":"176ce0015667d18e6dae1e6e2c6390b78f89cbb8","size":3738,"noattachment":false,"key":"/http-raw/-/http-raw-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-0.0.1.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355539526766,"_cnpm_publish_time":1355539526766,"_hasShrinkwrap":false},"0.0.0":{"name":"http-raw","version":"0.0.0","description":"expose the raw request data in an http server","main":"index.js","directories":{"example":"example","test":"test"},"dependencies":{},"devDependencies":{"tap":"~0.3.0","through":"~2.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"homepage":"https://github.com/substack/http-raw","keywords":["http","raw","server","proxy"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","_id":"http-raw@0.0.0","dist":{"shasum":"3b7fc982782db851b03a5ccea3785a99c0c42016","size":3692,"noattachment":false,"key":"/http-raw/-/http-raw-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/http-raw/download/http-raw-0.0.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"publish_time":1355469610056,"_cnpm_publish_time":1355469610056,"_hasShrinkwrap":false}},"readme":"# http-raw\n\nexpose the raw request data in an http server\n\n[![build status](https://secure.travis-ci.org/substack/http-raw.png)](http://travis-ci.org/substack/http-raw)\n\n# example\n\n``` js\nvar createServer = require('http-raw');\nvar through = require('through');\n\nvar server = createServer(function (req, res) {\n    if (req.method === 'GET') {\n        res.end('beep boop\\n');\n    }\n    else {\n        var bs = req.createRawBodyStream();\n        bs.write('HTTP/1.1 200 OK\\r\\n\\r\\n');\n        bs.pipe(upper()).pipe(bs)\n    }\n});\nserver.listen(7000);\n\nfunction upper () {\n    return through(function (buf) {\n        this.emit('data', String(buf).toUpperCase());\n    });\n}\n```\n\n```\n$ node example/server.js &\n$ nc localhost 7000\nPUT / HTTP/1.1\nHost: robots\n\nHTTP/1.1 200 OK\n\n\nbeep \nBEEP\nboop\nBOOP\n```\n\n# methods\n\n``` js\nvar createServer = require('http-raw')\n```\n\nThe http-raw api is exactly like the `http.createServer(cb)` api from core,\nexcept that 2 extra functions are available on the `req` objects from the\n`cb(req,res)` handler:\n\n## req.createRawStream()\n\nReturn a readable/writable stream `s`. `s` will emit all the raw data from the\nconnection, including the buffered header data without doing any parsing on the\ndata beforehand.\n\nWriting to `s` goes through to the underlying network socket without any\nadditional framing applied.\n\n## var s = req.createRawBodyStream()\n\nReturn a readable/writable stream `s`. `s` will emit the raw data from after the\nheaders have been parsed, including any framing without doing any parsing.\n\nWriting to `s` goes through to the underlying network socket without any\nadditional framing applied.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_attachments":{},"readmeFilename":"readme.markdown","homepage":"https://github.com/substack/http-raw","license":"MIT"}