Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Conversation

@sandeepmistry
Copy link
Contributor

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.

@facchinm facchinm self-requested a review June 13, 2017 12:59
iniflags.Parse()

// Export the proxy info
exportProxyEnvVars(http_proxy, https_proxy, all_proxy)
Copy link
Contributor

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?

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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
@sandeepmistry sandeepmistry changed the title [WIP] Add support for proxied networks Add support for proxied networks Jun 15, 2017
@sandeepmistry
Copy link
Contributor Author

@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.

@facchinm facchinm merged commit 4c380fe into master Jun 15, 2017
@facchinm
Copy link
Member

facchinm commented Jun 15, 2017

Vendoring @sandeepmistry 's fork until paho guys merge the patch (https://github.com/sandeepmistry/paho.mqtt.golang/tree/all_proxy)

@sandeepmistry
Copy link
Contributor Author

Upstream PR created: eclipse-paho/paho.mqtt.golang#114

@facchinm facchinm deleted the proxy branch July 25, 2017 15:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants