-
-
Notifications
You must be signed in to change notification settings - Fork 21
Add support for proxied networks #4
Conversation
| iniflags.Parse() | ||
|
|
||
| // Export the proxy info | ||
| exportProxyEnvVars(http_proxy, https_proxy, all_proxy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you export the env variables and then read them in another function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could be externally configured via environment while not passed as parameters I believe, so we must handle both the cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also export them so the spawned sketches can access the proxy settings, this is how Ubuntu shares them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I would pass them directly to the function after exporting them. And I would write a comment explaining why we export them.
To handle environmental variables we could maybe use https://github.com/namsral/flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm also going to explore using https://gowalker.org/golang.org/x/net/proxy#RegisterDialerType and https://godoc.org/golang.org/x/net/proxy#FromURL for the MQTT connection, this will clean things up as well.
http.DefaultTransport uses the http_proxy and https_proxy env. var. by default
|
@facchinm has verified the MQTT over the SOCKS5 proxy is working with the following fork of the Paho MQTT lib: https://github.com/sandeepmistry/paho.mqtt.golang/tree/all_proxy He will verify the sketch downloads via HTTPS shortly. |
|
Vendoring @sandeepmistry 's fork until paho guys merge the patch (https://github.com/sandeepmistry/paho.mqtt.golang/tree/all_proxy) |
|
Upstream PR created: eclipse-paho/paho.mqtt.golang#114 |
Related to https://github.com/arduino/webide/issues/2443 and https://github.com/arduino/webide/pull/2448.
Still need to find away to use the SOCKS proxy for MQTT.