emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.59k stars 418 forks source link

Handshake error on CocoaMQTT over web socket #364

Closed sadeghgoo closed 3 years ago

sadeghgoo commented 3 years ago

When i want connecting to MQTT via web socket delegate send MQTT disconnected with error and pass handshake error. here's my code:

  let websocket = CocoaMQTTWebSocket(uri: connectionConfig.uri)
    mqtt = CocoaMQTT(clientID: connectionConfig.clientID, host: connectionConfig.host, port: connectionConfig.port, socket: websocket)
    mqtt?.username = connectionConfig.username
    mqtt?.password = connectionConfig.password
    mqtt?.autoReconnect = true
    mqtt?.autoReconnectTimeInterval = 3
    mqtt?.delegate = self
    mqtt?.cleanSession = true
    mqtt?.enableSSL = true
    _ = mqtt?.connect(timeout: 4.0)
dilldilldill commented 2 years ago

I see that you closed your own issue? Does this mean you solved it? How?