cozy-monitor
cozy-monitor copied to clipboard
Cannot use behind a proxy
Hi,
At work, I must use a connection behind a proxy. But cozy-monitor seems to use "request-json-light" that is the same lib as "request-json" without "request" dependencies. Then proxy settings cannot be applied.
Is there a way to use cozy-monitor behind a proxy?
Hi @lcotonea,
Thank you for your usecase. I think the simpler way is to contribute to request-json-light or at least telling us what is required to work behind a proxy.
As request (https://github.com/request/request#Proxies), request-json-light should respect the following variables:
- 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. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the proxy configuration option. Furthermore, the proxy configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.
request is also aware of the NO_PROXY/no_proxy environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to * to opt out of the implicit proxy configuration of the other environment variables.