Pipe the request directly
This commit is contained in:
parent
8612ee9ee4
commit
2f102b06c3
10
index.js
10
index.js
@ -26,8 +26,17 @@ function startServer() {
|
||||
body.push(chunk);
|
||||
}).on("end", () => {
|
||||
body = Buffer.concat(body).toString();
|
||||
|
||||
console.log(req.path);
|
||||
logger.info({message: "Got a message!"});
|
||||
logger.info({message: req});
|
||||
let connector = http.request(
|
||||
req.headers["Host"], {
|
||||
headers: req.headers,
|
||||
}, (resp) => {
|
||||
resp.pipe(res);
|
||||
});
|
||||
req.pipe(connector);
|
||||
})
|
||||
})
|
||||
|
||||
@ -40,4 +49,3 @@ function startServer() {
|
||||
}
|
||||
|
||||
startServer();
|
||||
module.exports = [parseHttpRequest];
|
||||
|
Loading…
Reference in New Issue
Block a user