HTTP proxy support
bouchezb opened this issue · 2 comments
Hi i try to use the module behind an http proxy.
I get this error :
2018-01-05 16:42:24 [10744] [error]: uncaughtException: connect ETIMEDOUT 216.58.208.211:443
Error: connect ETIMEDOUT 216.58.208.211:443
at Object._errnoException (util.js:999:13)
at _exceptionWithHostPort (util.js:1020:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1207:14) {
"error": {
"errno": "ETIMEDOUT",
"code": "ETIMEDOUT",
"syscall": "connect",
"address": "216.58.208.211",
"port": 443
},
"stack": "Error: connect ETIMEDOUT 216.58.208.211:443\n at Object._errnoException (util.js:999:13)\n at _exceptionWithHostPort (util.js:1020:20)\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1207:14)"
On the request
module page i can see that i can override defaults.
var r = request.defaults({'proxy':'http://localproxy.com'})
How can i use it with node-pushbullet-api
?
Until it's added, have you tried using environment variables? From the request documentation it states:
The following environment variables are respected by request:
HTTP_PROXY / http_proxy
HTTPS_PROXY / https_proxy
NO_PROXY / no_proxy
When HTTP_PROXY / http_proxy are set, they will be used to proxy non-SSL requests that do not have an explicit proxy configuration option present. Similarly, HTTPS_PROXY / https_proxy will be respected for SSL requests that do not have an explicit proxy configuration option.
I would say that the environment variable method is good enough rather than adding code to the package.