RocketChat / Rocket.Chat.Apps-cli

The CLI for interacting with Rocket.Chat Apps
MIT License
46 stars 27 forks source link

Deployment using a proxy server #118

Closed mrsimpson closed 2 years ago

mrsimpson commented 2 years ago

In a corporate environment, deployment using a proxy is not possible:

 ›   Error:    ⟿  Problems conecting to Rocket.Chat at  <some url which can only be reached via proxy>

The reason is that node-fetch does not natively support a proxy.

graywolf336 commented 2 years ago

Do you have any suggestions on how to fix this?

mrsimpson commented 2 years ago

In general: Inject a custom http.Agent (see the long-lasting node-fetch-issue). However, you'd want to read the proxy settings from a file in order to create the agent. There are many (small / not too popular) packages doing this, e. g. https://www.npmjs.com/package/fetch-with-proxy

mrsimpson commented 2 years ago

As you can see, the source of the above package is very compact and does just that: parse the env variables and configure the agent. Probably, ~most~ too many devs just copy-paste instead of adding the dependencies 😬