Skip to content
Advertisement

Connection failed – trying to connect to the mosquitto broker using React native

I tried to bind MQTT with the react native. When trying to connect to the broker, when I run my code, After a few minutes I get the following error:

here is the error Object { “errorCode”: 7, “errorMessage”: “AMQJS0007E Socket error:undefined.”, “invocationContext”: undefined, }

JavaScript

Advertisement

Answer

We solved this by edit the mosquitto config file to either add a new listener port 8883 and to use the websocket protocol for that port https://stackoverflow.com/a/32309525/12166187

Advertisement