Apollon77 / alexa-remote

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for running behind proxy

cernst1980 opened this issue · comments

I´am using ioBroker behind a proxy server due to security reasons and this module does not currently support using a proxy server which is configured via environment variable HTTPS_PROXY.

Can you please add module https-proxy-agent and use process.env.HTTP_PROXY ad proxy server.

https://www.npmjs.com/package/https-proxy-agent

Library wise I think reacting on env variables is no option. I can check if it can be provided as a config variable.

For UNIX/Linux proxy usage can be controlled by using environment variables, that's a standard way.
E.g. https://access.redhat.com/documentation/en-us/openshift_container_platform/3.4/html/installation_and_configuration/install-config-http-proxies

As ioBroker does currently not support globally configuring proxies, I tried it that way and it works for most adapters, which mainly use request library.
Request library considers the proxy env variables by default.
https://github.com/request/request#proxies

Unfortunately, that's not the case for other libraries like https.
For these libraries, https-proxy-agent is the answer.

Of course, a config variable is also a good solution, but then all other adapters (which need to connect to the internet) need to support these proxy config...

So the easiest solution is env variable, the better is a global proxy config which all adapters support.

Hm ... interesting - did't know that from request ... but in fact request is reprecated, so new kids on the block are axios and got and such ... not Ideas how they behave ;-)
I need to think about and especially find time :-(