chill117 / proxy-verifier

NodeJS module to check proxies: if functional, anonymity level, tunneling, supported protocols.
MIT License
76 stars 16 forks source link

Added section about passing options to request #24

Open stylesuxx opened 5 years ago

stylesuxx commented 5 years ago

When you want to pass options to the request call, it is not enough to set them in the options argument, they need to be within the key requestOptions.

Also I think, that the user passed options should be the last ones applied and override anything that is set by the library. Right now the library is overwriting some of the options.

I would suggest setting the user options for requests before the actual call to request:

https://github.com/chill117/proxy-verifier/blob/ff1d21e9d3c429de2ead426848b061ed1a82579f/index.js#L388

I am aware this can break the call - but if the user is passing options to request, I guess he knows what he is doing.

If you like the idea I can submit a PR.