Closed
Description
I'm using unit:node Docker image and I encountered double sending of http requests.
Looks like a bug, but I'm not qualified enough to dive deeper into the problem.
The situation can be repeated on the simplest configuration:
- Use a pure image unit:node, basic Unit configuration and copy there a .js file with sending an http request from anywhere
const http = require("unit-http");
const options = {
hostname: "<your hostname>",
port: 80,
path: "/<your path>",
method: "GET",
};
const req = http.request(options, (res) => {
let responseData = "";
res.on("data", (chunk) => {
responseData += chunk;
});
res.on("end", () => {
console.log("Response:", responseData);
});
});
req.on("error", (error) => {
console.error("Error:", error);
});
req.end();
const server = http.createServer();
server.listen();
- When we launch the container we will see one line in the logs, but when we look at the logs of the target server we will actually see two requests
Metadata
Metadata
Assignees
Labels
No labels