{"_id":"http-raw","_rev":"29-20981504ebb9f71ae7db1f9d9411da1e","name":"http-raw","description":"expose the raw request data in an http server","dist-tags":{"latest":"2.1.0"},"versions":{"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","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","_id":"http-raw@0.0.0","dist":{"shasum":"3b7fc982782db851b03a5ccea3785a99c0c42016","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-0.0.0.tgz","integrity":"sha512-rcO3vE3o2jcTeK6nb77C5xKPgd2S5PLfPF94ogpYwq/02OUxMHodkpJUsIDm+cUZLxu1vNN/PmmXCoKnRs0Wow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFR5wZXJ3nA5KZdU14iwOYszegxPMJVkx1vs6AWfrVFsAiEAsrVxc8GvuINeR9jEKcYq/CF2+uRIBCr2rRQ4TAoMviw="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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","_id":"http-raw@0.0.1","dist":{"shasum":"176ce0015667d18e6dae1e6e2c6390b78f89cbb8","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-0.0.1.tgz","integrity":"sha512-1cCBRqjfVS206mDsmNera+nbNbyig13VnFfq1zX2gt4RzmkM/b8Ua+GNSwjQtzsR7ZVmZHzA/3SnhaVgcSxduQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCIjIhfGsqpRE0HjTmNftPcJGoy8CGBbLQghpVj+oiFwIhAOaeJbx/l+pilG1ZbqGhHHcj2yggBYn6kEIywyOTwWYn"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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## var s = 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\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\nOn the same tick as the response handler, `s.buffers` will have all all the\nbuffer slices formatted as an array where each element is an array:\n\n``` js\n[ buffer, start, end ]\n```\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\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\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_id":"http-raw@0.0.2","dist":{"shasum":"35109da445a032fafb632296d3150f47afa9bd42","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-0.0.2.tgz","integrity":"sha512-+XGMAGsgA7zBWPZmbNt4evRoxGogkVszZaHUMBXEZiCMou0wnoodp37HebLS1NYco8wmqG0E0xtzDGjkszgVyQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr0T7Ux8Gi9oo1tiwLkp9BoZwvu+ZJ8h5VWaCJWqHweAiEAg9s+Osmo5G7fUSpIRtzBJtm9b+13R2T87Jt2NO68eXc="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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## var s = 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\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\nOn the same tick as the response handler, `s.buffers` will have all all the\nbuffer slices formatted as an array where each element is an array:\n\n``` js\n[ buffer, start, end ]\n```\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\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\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_id":"http-raw@0.0.3","dist":{"shasum":"0e16b3395486345892b71eb45229295869385680","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-0.0.3.tgz","integrity":"sha512-7kWRuiUV18rsX3KThjbnbHJZUrRU1CNevgY/RWsqRb16p8GHOmEc/Lz5EOCjIMOQBKNMr8/02/oTglBacuQP6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+Q55G5J4QnK+ojqJJRCR9R58e0l2eKFxoRisUSlA7vQIgcqNMUe9tOI8FoKy1X4hp+b7Rpv/2qyJGdGDs7/ZezuI="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents:\n\n## var s = 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\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\nOn the same tick as the response handler, `s.buffers` will have all all the\nbuffer slices formatted as an array where each element is an array:\n\n``` js\n[ buffer, start, end ]\n```\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\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\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_id":"http-raw@0.1.0","dist":{"shasum":"1aa419236431d28737436cb5fbf5e1b65a88d550","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-0.1.0.tgz","integrity":"sha512-5zsd6q+63Shy9iDOrWNoSBfY7EPLNtLlHuDwSCrpboOvC/HOcMi7DcJwuuzwB1hPKypWUJZ2EneLIqjnXiIxRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8KYgo4vhSBWcwH8vM0HekFAYKFmoDC6tqphBCtC9qAAiEA5y9uL0LialLAIINolMy8nM8tsUC/OV3S4/ODQOFxjA0="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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 httpRaw = 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[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents:\n\n## var server = httpRaw(cb)\n\nCreate a new http server with extended raw stream functions.\n\n## var server = httpRaw.https(options, cb)\n\nCreate a new https server with extended raw stream functions.\n\n## var s = 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\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\nOn the same tick as the response handler, `s.buffers` will have all all the\nbuffer slices formatted as an array where each element is an array:\n\n``` js\n[ buffer, start, end ]\n```\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\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\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_id":"http-raw@0.2.0","dist":{"shasum":"3082e58cf65ba629eb6982a0108b4f4348bf83e5","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-0.2.0.tgz","integrity":"sha512-k0GToDj44AZQ02LAFrE6sX2Q/SjO2A9B+cj0ceLOIoKwFPcTSe8dMywzl0vFhSZBV3/Z7KoPeBIo8osZVhlmSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLEaRyhlcYvavgC4u3Fp0/ivd4DTE59X3HKtLSfxPk4AiARTwj6gOTl6taRHPVB67748ZyzLjhjKrt9oSpouIgl4A=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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 rs = req.createRawBodyStream();\n        var ws = res.createRawStream();\n        \n        ws.write('HTTP/1.1 200 OK\\r\\n\\r\\n');\n        rs.pipe(upper()).pipe(ws)\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 httpRaw = require('http-raw')\n```\n\nThe http-raw api is exactly like the `http.createServer(cb)` api from core,\nexcept for the extra functions documented below that get attached to the `req`\nand `res` objects in the\n[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents.\n\n## var server = httpRaw(cb)\n\nCreate a new http server with extended raw stream functions.\n\n## var server = httpRaw.https(options, cb)\n\nCreate a new https server with extended raw stream functions.\n\n## var rs = req.createRawStream()\n\nReturn a readable stream `rs`. `rs` will emit all the raw data from the\nconnection, including the buffered header data without doing any parsing on the\ndata beforehand.\n\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\nOn the same tick as the response handler, `s.buffers` will have all all the\nbuffer slices formatted as an array where each element is an array:\n\n``` js\n[ buffer, start, end ]\n```\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\n\n## var ws = res.createRawStream()\n\nReturn a writable stream `ws` that will be written directly to the underlying\nnetwork socket without any additional framing added.\n\n## var bs = req.createRawBodyStream()\n\nReturn a readable stream `bs` like the stream returned by\n`req.createRawStream()`, but only emit the raw body data, not the headers.\n\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_id":"http-raw@1.0.0","dist":{"shasum":"9caf07513fd6023ba804a532270597142dace4f8","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-1.0.0.tgz","integrity":"sha512-BCstnES3l6krbsh7vTwON13skK14TulyQ9GEwI5/Z0LLT7BYa2l6DMD+XdrWLuHx/1MOaKQ6NW+iXvqM23JM7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDtjwFOeP0G08+9XgIJkPbwLkxgi0x91lSIaUQvmhxCOAiB/HvoiH+plrLMDiat37R1s4puhaXgdeRwHZJ5vBeQCew=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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 rs = req.createRawBodyStream();\n        var ws = res.createRawStream();\n        \n        ws.write('HTTP/1.1 200 OK\\r\\n\\r\\n');\n        rs.pipe(upper()).pipe(ws)\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 httpRaw = require('http-raw')\n```\n\nThe http-raw api is exactly like the `http.createServer(cb)` api from core,\nexcept for the extra functions documented below that get attached to the `req`\nand `res` objects in the\n[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents.\n\n## var server = httpRaw(cb)\n\nCreate a new http server with extended raw stream functions.\n\n## var server = httpRaw.https(options, cb)\n\nCreate a new https server with extended raw stream functions.\n\n## var rs = req.createRawStream()\n\nReturn a readable stream `rs`. `rs` will emit all the raw data from the\nconnection, including the buffered header data without doing any parsing on the\ndata beforehand.\n\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\nOn the same tick as the response handler, `s.buffers` will have all all the\nbuffer slices formatted as an array where each element is an array:\n\n``` js\n[ buffer, start, end ]\n```\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\n\n## var ws = res.createRawStream()\n\nReturn a writable stream `ws` that will be written directly to the underlying\nnetwork socket without any additional framing added.\n\n## var bs = req.createRawBodyStream()\n\nReturn a readable stream `bs` like the stream returned by\n`req.createRawStream()`, but only emit the raw body data, not the headers.\n\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","_id":"http-raw@1.1.0","dist":{"shasum":"9ff35039814ac4e73c3f2eae3055d63b40b117f9","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-1.1.0.tgz","integrity":"sha512-23bJT/JCR4CkOQis6m0KoE4bzx3HMVSk0Nly4NZQNr9rrrtcXtPjq4yifkO68RlXpdetdheiMuVjz0Lh75gtkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDERN19PsOkBqV6tbYMh1rSeTKL9aRiVSKBNlNuvfVO0gIhAONIA+r7GyIq8ouFynMwZDoGh39INpz+/culQEP7EL9G"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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 rs = req.createRawBodyStream();\n        var ws = res.createRawStream();\n        \n        ws.write('HTTP/1.1 200 OK\\r\\n\\r\\n');\n        rs.pipe(upper()).pipe(ws)\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 httpRaw = require('http-raw')\n```\n\nThe http-raw api is exactly like the `http.createServer(cb)` api from core,\nexcept for the extra functions documented below that get attached to the `req`\nand `res` objects in the\n[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents.\n\n## var server = httpRaw(cb)\n\nCreate a new http server with extended raw stream functions.\n\n## var server = httpRaw.https(options, cb)\n\nCreate a new https server with extended raw stream functions.\n\n## var rs = req.createRawStream()\n\nReturn a readable stream `rs`. `rs` will emit all the raw data from the\nconnection, including the buffered header data without doing any parsing on the\ndata beforehand.\n\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\n## var ws = res.createRawStream()\n\nReturn a writable stream `ws` that will be written directly to the underlying\nnetwork socket without any additional framing added.\n\n## var bs = req.createRawBodyStream()\n\nReturn a readable stream `bs` like the stream returned by\n`req.createRawStream()`, but only emit the raw body data, not the headers.\n\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","readmeFilename":"readme.markdown","_id":"http-raw@2.0.0","dist":{"shasum":"1b41702f4077cd6e4b0fc167d607e9aa0942dd10","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-2.0.0.tgz","integrity":"sha512-sI+gIGWgoaGK0bE4aml3nuRS1+QoGGNdIS3rpiwr0QO1CevO1CL7qdbysxC+cCpEPkn6kt8n/GyNWyambjAt7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpFNqfjJa3JjdtKB3dkBLWmmDVKI5J1Cf7hRdrfymzmAIgI9K7AAbg4SZFwTYhtD3y4K3DdTgWVeF46aeegs4AV80="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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 rs = req.createRawBodyStream();\n        var ws = res.createRawStream();\n        \n        ws.write('HTTP/1.1 200 OK\\r\\n\\r\\n');\n        rs.pipe(upper()).pipe(ws)\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 httpRaw = require('http-raw')\n```\n\nThe http-raw api is exactly like the `http.createServer(cb)` api from core,\nexcept for the extra functions documented below that get attached to the `req`\nand `res` objects in the\n[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents.\n\n## var server = httpRaw(cb)\n\nCreate a new http server with extended raw stream functions.\n\n## var server = httpRaw.https(options, cb)\n\nCreate a new https server with extended raw stream functions.\n\n## var rs = req.createRawStream()\n\nReturn a readable stream `rs`. `rs` will emit all the raw data from the\nconnection, including the buffered header data without doing any parsing on the\ndata beforehand.\n\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\n## var ws = res.createRawStream()\n\nReturn a writable stream `ws` that will be written directly to the underlying\nnetwork socket without any additional framing added.\n\n## var bs = req.createRawBodyStream()\n\nReturn a readable stream `bs` like the stream returned by\n`req.createRawStream()`, but only emit the raw body data, not the headers.\n\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","readmeFilename":"readme.markdown","_id":"http-raw@2.0.1","dist":{"shasum":"f1f12a2e554001855633969a1bb0b2814db028f7","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-2.0.1.tgz","integrity":"sha512-fZeyVRfAdeT2xT91lc3FYKFdg5RXMWXsPLvRNndZE3jdZVxbe/fUKpN4c4D8k3MOoAEpu9bg+/6ycJf0epxwQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDa/sSsnk2Um0/UlkWEfG3TN3bcQIYuW+S3/aBzlXdlAiEAsfBjqhPuGsLh6TtdpWO1OqSONUVvBRJLXhp8XF0/EeU="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"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","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 rs = req.createRawBodyStream();\n        var ws = res.createRawStream();\n        \n        ws.write('HTTP/1.1 200 OK\\r\\n\\r\\n');\n        rs.pipe(upper()).pipe(ws)\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 httpRaw = require('http-raw')\n```\n\nThe http-raw api is exactly like the `http.createServer(cb)` api from core,\nexcept for the extra functions documented below that get attached to the `req`\nand `res` objects in the\n[`'request'`](http://nodejs.org/docs/latest/api/http.html#http_event_request)\nand\n[`'upgrade'`](http://nodejs.org/docs/latest/api/http.html#http_event_upgrade)\nevents.\n\n## var server = httpRaw(cb)\n\nCreate a new http server with extended raw stream functions.\n\n## var server = httpRaw.https(options, cb)\n\nCreate a new https server with extended raw stream functions.\n\n## var rs = req.createRawStream()\n\nReturn a readable stream `rs`. `rs` will emit all the raw data from the\nconnection, including the buffered header data without doing any parsing on the\ndata beforehand.\n\nOn the same tick as the response handler, `s.buffers` will contain an array of\nall the buffered data.\n\nOn the next tick `s.buffers` gets set to undefined to it can be garbage\ncollected.\n\nTo get all the data, `req.createRawStream()` must be fired on the same tick as\nthe response callback.\n\n## var ws = res.createRawStream()\n\nReturn a writable stream `ws` that will be written directly to the underlying\nnetwork socket without any additional framing added.\n\n## var bs = req.createRawBodyStream()\n\nReturn a readable stream `bs` like the stream returned by\n`req.createRawStream()`, but only emit the raw body data, not the headers.\n\nTo get all the data, `req.createRawBodyStream()` must be fired on the same tick\nas the response callback.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-raw\n```\n\n# license\n\nMIT\n","readmeFilename":"readme.markdown","_id":"http-raw@2.1.0","dist":{"shasum":"f36efe2514fff95d384be6f46684806712b8879a","tarball":"https://registry.npmjs.org/http-raw/-/http-raw-2.1.0.tgz","integrity":"sha512-eI8lLQXVvFD+G4qKo2ghqg6JCYtaaJMwc6/ij0gg4MF/RBE7pMdvLnQ40u3idQKeIRd7qmv5v7nrFfz/T3b1lQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRE+Pd+4KzAtHBrlsgRQlQ9/ws8NIThRUuy0xAd/kxCAIgVj6wHJdLmZav7bl9DbccpWj/f0f3QNpR+a/d4oksGSI="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]}},"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","maintainers":[{"email":"nopersonsmodules@gmail.com","name":"nopersonsmodules"}],"time":{"modified":"2022-11-08T10:39:36.348Z","created":"2012-12-14T07:20:06.142Z","0.0.0":"2012-12-14T07:20:10.056Z","0.0.1":"2012-12-15T02:45:26.766Z","0.0.2":"2012-12-15T03:09:19.006Z","0.0.3":"2012-12-15T06:52:05.058Z","0.1.0":"2012-12-15T09:18:16.928Z","0.2.0":"2012-12-15T10:24:15.522Z","1.0.0":"2012-12-17T03:11:41.297Z","1.1.0":"2012-12-17T08:54:49.123Z","2.0.0":"2013-03-19T05:12:11.248Z","2.0.1":"2013-03-19T05:17:03.794Z","2.1.0":"2013-03-19T06:25:17.843Z"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/http-raw.git"},"users":{"wenbing":true,"monolithed":true}}