I have added this agent in express request, my question is to support keep alive tcp connection does server need to return some header as well or only client need to send it. ???
var myAgent = new http.Agent({
keepAlive: true,
maxSockets: 1,
keepAliveMsecs: 30000,
});
request.post(
{
url: "server_url",
agent: myAgent,
form: { key: "value" },
},
function (err, res, body) {
if (res.statusCode !== 200) {
} else {
//set header cookie from response and send second request
}
}
);