FlowFuse / device-agent

An agent to run FlowFuse managed instances of Node-RED on devices
Apache License 2.0
15 stars 8 forks source link

Support connection via a proxy #268

Closed knolleary closed 3 months ago

knolleary commented 4 months ago

We currently do not support running the Device Agent behind a proxy. We have a customer request to do so.

There are two parts to consider:

  1. any HTTP request the agent makes
  2. any MQTT over WebSockets request the agent makes

The mqtt library allows us to pass in a wsOptions object which in turn can have an agent property which will allows us to add an agent with a proxy configuration.

The got library will have similar support for the same.

We need to then decide how a user should provide their proxy configuration. One option would be to have it in the device.yml to keep things contained. But we have the boot-strap issue of the quick connect mode that generates the device.yml needs to be able to contact the platform first. So we should support the standard HTTP(S)_PROXY env vars - no need to do all combinations of upper/lower case, lets just be opinionated and support one common flavour.

### Tasks
- [ ] https://github.com/FlowFuse/device-agent/issues/270
- [ ] https://github.com/FlowFuse/nr-project-nodes/issues/80
- [ ] https://github.com/FlowFuse/nr-file-nodes/issues/55
- [ ] https://github.com/FlowFuse/flowfuse/issues/4023
Steve-Mcl commented 4 months ago

As per discussion and backed up by this article, I have went with lower case variant.

Working branch proxy-support - I will raise a draft PR on very shortly.

An additional task this development work threw up is the need for the project nodes to also have proxy support.

Steve-Mcl commented 3 months ago

Increased to size-5 due to the additional places needing work (project link, file nodes) and the testing env setup needed to properly test all of this.

knolleary commented 3 months ago

All tasks complete - closing off.