Skip to content

examples/mqtt-ws-server.rs not worked wss with mqttx #190

@aamalev

Description

@aamalev
  1. If use examples/mqtt-ws-client.rs - is ok

  2. If use mqttx - not worked

$ mqttx pub -l wss --hostname 127.0.0.1 --port 8883 --mqtt-version 3.1.1 -t topic -m message --content-type text --insecure
✖ Exceed the maximum reconnect times limit, stop retry

log:

[2025-02-24T10:22:51Z TRACE ntex_io::tasks] : New 359 bytes available, wakeup dispatcher
Connection is established, select protocol
HTTP protocol is selected
[2025-02-24T10:22:51Z TRACE ntex::http::service] New http connection, peer address Some(127.0.0.1:63122), in-flight: 1
[2025-02-24T10:22:51Z DEBUG ntex_io::ioref] : Start timer Seconds(1)
[2025-02-24T10:22:51Z TRACE ntex::http::h1::dispatcher] : Trying to read http message
[2025-02-24T10:22:51Z TRACE ntex::http::h1::dispatcher] : Http message is received:
    Request HTTP/1.1 GET:/mqtt
      headers:
        "sec-websocket-key": "qVwximovjHWf983lpkfwIw=="
        "connection": "Upgrade"
        "sec-websocket-version": "13"
        "sec-websocket-extensions": "permessage-deflate; client_max_window_bits"
        "upgrade": "websocket"
        "sec-websocket-protocol": "mqtt"
        "host": "127.0.0.1:8883"
     and payload Stream(PayloadDecoder { kind: Cell { value: Eof } })
[2025-02-24T10:22:51Z DEBUG ntex::http::h1::dispatcher] IO: Dispatcher is stopped
[2025-02-24T10:22:51Z TRACE mqtt] Got http request:
    Request HTTP/1.1 GET:/mqtt
      headers:
        "sec-websocket-key": "qVwximovjHWf983lpkfwIw=="
        "connection": "Upgrade"
        "sec-websocket-version": "13"
        "sec-websocket-extensions": "permessage-deflate; client_max_window_bits"
        "upgrade": "websocket"
        "sec-websocket-protocol": "mqtt"
        "host": "127.0.0.1:8883"

[2025-02-24T10:22:51Z TRACE mqtt] WebSocket handshake is completed
[2025-02-24T10:22:51Z TRACE ntex_io::tasks] : Tcp stream is disconnected
[2025-02-24T10:22:51Z TRACE ntex_io::tasks] : Write task is instructed to terminate
[2025-02-24T10:22:51Z DEBUG ntex_io::ioref] : Stop timer
[2025-02-24T10:22:51Z TRACE ntex_io::ioref] : Force close io stream object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions