New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify that defaults() does not modify global defaults #1251
Conversation
This has come up several times recently, for example request#1150 and request#1249.
@nylen I wonder if we use |
If I understand you correctly, I think we cover this adequately in the readme:
|
Clarify that defaults() does not modify global defaults
Thanks @nylen Could you give an example how to create a Please excuse my little knowledge on these things. |
We already did it at #1250 (comment): unirest.request = unirest.request.defaults({ pool : { maxSockets : 5 } }); Or: // As the documentation says, this won't work inside a loop.
request({ pool : { maxSockets : 5 }, ... }, function(err, res, body) { ... }); |
If it does not work in that way, what's the use case of Thanks. |
With this change (remove the ## client.coffee
request = require 'request'
+poolOptions =
+ maxSockets: 5
exports.send = (req, res, next) ->
options =
url: "https://google.com.au"
strictSSL: true
secureProtocol: true
- pool:
- maxSockets: 5
+ pool: poolOptions
request options, (err, response, body) ->
res.send 200, body |
how come I missed the second part.. should not reply during the meeting :)
Thanks a lot for your nice help!! |
What if I need to global setting some options, such as strictSSL: false? |
This has come up several times recently, for example #1150 and #1249.