-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow passing custom HTTP Agent #14
Comments
Request accepts a custom agent through its Let me know if that works for you. |
OK that's good to know. By the way, is it possible to do this?
|
Oh, you can actually use the client.query()
.get('account/verify_credentials')
.auth(opts.access_token, opts.access_secret)
.options(REQUEST_OPTIONS)
.request(function(err, res, body) {
... Totally forgot about that. As for this question:
I'm working on a rewrite where the Purest's logic is extracted into modules that consume a common interface, so as long as you write a thin wrapper for your HTTP client of choice exposing the same interface, Purest will be able to use it. |
Cool, and didn't know you were already working on the abstraction! |
Yes, it will be a major release because I'll probably break a few things, for the benefit of having more flexible solution :) |
This enables passing custom agent when you can, say, proxy a request, or accept self-signed certificate.
The proxy options is especially useful to me because here in China, many website do require a bit of network tunneling to work...
I did try to make it happen on Node.js core, but I guess that's probably too large a change to push forward, allowing custom agent passing on userland code seems like the best solution to me.
Alternative, which require more efforts, would be to allow user to take over the
request
module, eg. can I implement the same interface usingnode-fetch
instead ofrequest
?But really as long as I can make a request to Twitter using my local tunnel, I am a happy man.
ref:
The text was updated successfully, but these errors were encountered: