eclipse / paho.mqtt.android

MQTT Android
Other
2.92k stars 883 forks source link

Mqtt Client Can't connect through http proxy #501

Open onkariwaligunje opened 10 months ago

onkariwaligunje commented 10 months ago

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 proxy details to Mqtt while making a connect call to make a successful connection?

Any help is greatly appreciated. Thanks!

Android API Version Bug Seen on: and Android Version Bug Seen on: Android 13 (API level 33)

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)