How Do You Set Maxsockets In Node.js When Using Express?
Is there a way to modify the Node.js maxSockets setting when using the Express framework?
Solution 1:
Somewhere after you do var http = require('http')
, just add http.globalAgent.maxSockets = x
(where 'x' is the number of sockets you want).
Please note that if you are making requests over https, you will need to set maxSockets for https as well.
var https = require('https');
https.globalAgent.maxSockets = your_val_here;
Post a Comment for "How Do You Set Maxsockets In Node.js When Using Express?"