Closed cahyowhy closed 4 years ago
Don't know what you mean by dev environment or prod environment, this sounds like a flutter problem, the client doesn't change its behavior depending on its environment, the error is being generated by the Dart runtime, not the client.
seems this issue is happen when i use 443 port
Could you post the full log fromthe client connect, to use wss your server name should start with wss:// as in wss://mqtt.padipos.id I think
got failed host lookup
Post the log without the wss scheme
same
this is request header from browser using mqtt js
its solved with this
Socket._client =
MqttClient('wss://mqtt.padipos.id', "hanumaniswandi1@gmail.com");
Socket._client.keepAlivePeriod = 30;
Socket._client.port = 443;
Socket._client.logging(on: true);
Socket._client.useWebSocket = true;
Socket._client.websocketProtocols = ['mqtt'];
Socket._client.pongCallback = () => print("pong");
Socket._client.onConnected = () => print('conn: connected');
Socket._client.onDisconnected = () => print('conn: disconected');
MqttConnectMessage connectMessage = MqttConnectMessage()
.withWillTopic("WillMsg")
.withWillMessage("SocketConsume closed abnormally..!")
.withWillQos(Socket._qos)
.keepAliveFor(30)
.withProtocolVersion(4)
.withProtocolName('MQTT')
.withClientIdentifier("hanumaniswandi1@gmail.com")
.authenticateAs(
"eyJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiYWxnIjoiZGlyIn0..ieHSRO4s4kUp1jP0CCksHw.J4oFm9FPjZ8N5oM0FvICEIaTfaLj9TG-gst-lSHuhqz5ulGAMnh-192g-VBThDcpt-zsTr3FFFH_VEhJnhGmMBFAYRL_aKvYFMWGLTga56YWwrhvymF5qnoT76wG305DyOTJLgNhqwlu-cBGSAJ1zDKHrh2v06ES2HgwBQNqiSHGjdRDg7IT0xb1MpGFki3D.bnwWw_VoEMKHcvmsBQ37LVyssShlBK_xJlVdtMQxh2M",
password);
sory i update my issue... now i tried to make the options is same based on mqtt.js (btw the connection in mqtt.js is suceed)
but tried with this lib got an error.. this is my configurations
use mqtt_client: ^5.6.1
thank for your attention :)