I'am in a project where i need to establish the most possible http connections and keep them open for nat port testing, using node.js but I'm not sure how I could do it, till now i got this:
var http = require('http');
var http_options = {
hostname: '193.136.212.161',
port: 80,
path: '/',
method: 'GET',
agent: false,
headers: {
'Connection':'keep-alive'
}
};
var req = http.request(http_options)
.on("socket", function (socket) {
console.log('got connected!');
});
req.end();
unfortunely it closes the connection not keeping it alive, if i could have some tips to advance would be great.