Closed naychrist closed 1 year ago
I put a trace in and the string I am getting back from the broker is {"action":9,"error":{"message":"No authentication information provided. (See https://help.ably.io/error/40101 for help.)","code":40101,"statusCode":401,"nonfatal":false,"href":"https://help.ably.io/error/40101"},"timestamp":1688445446903}
despite me sending the correct username and pass. took a look at the link to see what I am missing but credentials are correct: https://faqs.ably.com/40101-invalid-credentials
I think the issue may be that ably only supports mqtts:// not wss://, which is the reverse of what this lib supports. Is it trivial to add support for mqtts? (i have reach out to ably support also)
OK, mqtts is just MQTT with secure working, see here as far as I can see, the client does support this using secure working but on the server side only, in the browser you can't use secure sockets only web sockets.
The broker should have responded to you using a correctly formed connect ack message with the relevant return code which in your case should be notAuthorized. It shouldn't return an arbitrary json string to an MQTT client.
Ok, looks like for flutter web I would need to wrap mqtt.js using dart's js interop. Still planning to use your MqttServerClient
for Flutter Mac and Windows Desktop. Have passed on your note re response to ably team. Thanks!
EDIT - actually makes more sense to wrap ably SDK when talking to that but will use browser client for another use case talking to local mosquitto server
hi there, I need to have a MQTT client working in both flutter web and flutter desktop. In some cases this will work with a local mosquito broker and in others it will work with Ably's MQTT adapter.
First I am trying to get the browser client to connect to Ably. The example code connects fine with 'wss://test.mosquitto.org' and port 8081. But when I try and connect to the ably broker I get an error. I can connect to it in javascript without issue as outlined here. But this is the log when trying to do the same using this lib:
Any advice? stripped back version of my code below: