Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mqtt Client Can't connect through http proxy #1024

Open
onkariwaligunje opened this issue Nov 27, 2023 · 1 comment
Open

Mqtt Client Can't connect through http proxy #1024

onkariwaligunje opened this issue Nov 27, 2023 · 1 comment

Comments

@onkariwaligunje
Copy link

Hello,

mqtt paho java client cannot connect to server through http proxy from an android device. Getting below error:
ERROR-MqttAgent Error message: Connection to the Mqtt Failed due to MqttException (0) - java.net.SocketTimeoutException: after 90000ms: isConnected failed: ETIMEDOUT (Connection timed out)

Tried to check if same issue is there using android service, but when using android service got below error:
java.lang.IllegalArgumentException: com.lenovo.udcsystem: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

Is there any way to send http proxy details to Mqtt while making a connect call to make a successful connection?

Any help is greatly appreciated.
Thanks!

[] Bug exists Release Version 1.1.1 (Java Repository Master Branch)
Bug exists in Snapshot Version 1.1.2-SNAPSHOT (Android Service Repository Master Branch)
Bug is just in the Sample Application.
Android API Version Bug Seen on: and Android Version Bug Seen on:
Android 13 (API level 33)
mqtt version : mqttv3 (1.2.5)

Please also check that if you have found the bug in the Release version (1.1.1) that you check that it also exists in the Snapshot (1.1.2-SNAPSHOT) before raising a bug.

Description of Bug:
Connect to server without having proxy set on android device - client gets connected to server
Connect to server after setting proxy on android device - client is unable to connect to server
Tried using ssl:// and wss:// for connection, but client is not able to connect to server through proxy
Proxy is http proxy

Console Log output (if available):
ERROR-MqttAgent Error message: Connection to the Mqtt Failed due to MqttException (0) - java.net.SocketTimeoutException: failed to connect to / (port 443) from / (port 47692) after 90000ms: isConnected failed: ETIMEDOUT (Connection timed out)

@onkariwaligunje
Copy link
Author

#1010
The changes in this PR provides proxy support. I tried building code and tested it and it does establishes the connection to over a proxy. Is there any plan to merge this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant