feat: support HTTP CONNECT proxy connection for built-in MQTT bridge#3531
feat: support HTTP CONNECT proxy connection for built-in MQTT bridge#3531jarhodes314 merged 16 commits intothin-edge:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
774416a to
748ab85
Compare
748ab85 to
6284826
Compare
6284826 to
0d9a6d5
Compare
0d9a6d5 to
21a1269
Compare
21a1269 to
8092d8a
Compare
Robot Results
|
|
Update There seems to still be some communication that does not go through the proxy. I've pushed a commit (9004271) which adds a system test which also sets iptables rules to block any traffic not coming from the gost proxy (excluding loopback traffic of course). The problem occurs somewhere within the
Though whilst exploring two things came up:
|
mappers Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Migrate cloud_root_certs to return a result rather than unwrapping Use a proxy.address configuration for scheme, host & port together Log proxy configuration on `tedge connect` Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
…oxy` configuration
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
7f89395 to
a3f7597
Compare
reubenmiller
left a comment
There was a problem hiding this comment.
Approved. Please wait for a Rust review though.
I'm ok with adding the user documentation in a follow up PR which can be created by someone else.
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
didier-wenzek
left a comment
There was a problem hiding this comment.
Approved. Thank you for this sustained effort. Yet another reason to prefer the builtin bridge!
| auth: match all_or_nothing(( | ||
| config.proxy.username.clone(), | ||
| config.proxy.password.clone(), | ||
| )) | ||
| .map_err(|e| anyhow::anyhow!(e))? | ||
| { | ||
| Some((username, password)) => rumqttc::ProxyAuth::Basic { username, password }, | ||
| None => rumqttc::ProxyAuth::None, | ||
| }, |
There was a problem hiding this comment.
cargo fmt is sometime confusing. I failed at first to read this as a regular match expression!
Proposed changes
Attempts to provide a solution to #3228 using HTTP CONNECT.
Adds support for HTTP CONNECT proxying to the Cumulocity bridge config in the built-in bridge as well as support for websocket connections, so we can use standard HTTPS proxying. Initially intended for enabling a customer to test this solves their issue.
MQTT proxying is only supported with the built-in bridge. If proxying is configured with the mosquitto bridge enabled, a warning will be displayed by
tedge connect/tedge-mapper, and the direct connection will not use the proxy (since this matches the behaviour of the bridge we are creating in this instance).I've tested this locally with go-gost and it works as intended both for MQTT and HTTP.
To enable proxy support:
Still TODO (now all done):
tedge connectdirect c8y connectionCheck the behaviour of HTTP/MQTT proxying with regard toHTTP_PROXY/NO_PROXYenvironment variablestedge connectoutputno_proxyconfiguration to allow users notTypes of changes
Paste Link to the issue
Checklist
just prepare-devonce)just formatas mentioned in CODING_GUIDELINESjust checkas mentioned in CODING_GUIDELINESFurther comments