You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please ask your question on StackOverflow. We have a great community over there. They have already answered thousands of questions and are happy to answer yours as well. See also our issue reporting guidelines.
The following code:
let XXXXX = new http.Agent({ keepAlive: true, maxSockets: 1})
for(let i=0;i<3;i++){
http.get({
hostname: 'localhost',
method:'GET',
port: 23659,
path: '/api/get/alive',
agent:XXXXX
}, resp => {
resp.on('data', data => {
console.log('data',data)
});
for (const key in XXXXX.sockets) {
console.log(key)
// if (XXXXX.sockets.hasOwnProperty(key)) {
// console.log(key + ": ", XXXXX.sockets[key]);
}
}).end()
}
When run in a VS Code plugin and capturing packets using Wireshark, you observed:
Connection: close
When run in a regular npm project, you observed:
Connection: keep-alive
I have been struggling with this issue for two days. Could you please help me take a look?
The text was updated successfully, but these errors were encountered: