ntex-mqtt icon indicating copy to clipboard operation
ntex-mqtt copied to clipboard

mqtt-ws-server.rs ws connection fail

Open diablur opened this issue 1 year ago • 0 comments

i run the ws example,and use mqttx to connect with protocol wss,but could not establish the connection.

➜ ntex-mqtt git:(master) ✗ cargo run --example mqtt-ws-server Compiling ntex-mqtt v0.11.4 (/home/boring/workspace/ntex-mqtt) Finished dev [unoptimized + debuginfo] target(s) in 4.76s Running target/debug/examples/mqtt-ws-server` [2023-08-25T04:59:52Z INFO ntex::server::builder] Starting 1 workers [2023-08-25T04:59:52Z INFO ntex::server::builder] Starting "mqtt" service on 0.0.0.0:8883 [2023-08-25T04:59:52Z TRACE ntex::server::accept] Starting server accept loop [2023-08-25T04:59:52Z INFO ntex::server::accept] Starting socket listener on 0.0.0.0:8883 [2023-08-25T04:59:52Z TRACE ntex::server::worker] Service "mqtt" is available [2023-08-25T04:59:52Z TRACE ntex::server::accept] Worker is available [2023-08-25T04:59:59Z TRACE ntex::server::accept] Accepting connection: Tcp(TcpStream { addr: 192.168.2.47:8883, peer: 192.168.2.89:50088, fd: 17 }) bp: false [2023-08-25T04:59:59Z TRACE ntex::server::accept] Sent to worker 0 [2023-08-25T04:59:59Z TRACE ntex::server::worker] Got socket for service: "mqtt" [2023-08-25T04:59:59Z TRACE ntex_io::tasks] new 230 bytes available, wakeup dispatcher [2023-08-25T04:59:59Z TRACE ntex_io::io] waking up io read task [2023-08-25T04:59:59Z TRACE ntex_io::tasks] new 85 bytes available, wakeup dispatcher Connection is established, chossing protocol [2023-08-25T04:59:59Z TRACE ntex_io::io] waking up io read task [2023-08-25T04:59:59Z TRACE ntex_io::tasks] new 277 bytes available, wakeup dispatcher [2023-08-25T04:59:59Z TRACE ntex_io::io] waking up io read task HTTP protocol is selected [2023-08-25T04:59:59Z TRACE ntex::http::service] New http connection, peer address Some(192.168.2.89:50088) [2023-08-25T04:59:59Z DEBUG ntex_io::ioref] start keep-alive timeout 3s [2023-08-25T04:59:59Z TRACE ntex::http::h1::dispatcher] trying to read http message [2023-08-25T04:59:59Z TRACE ntex::http::h1::dispatcher] http message is received: Request HTTP/1.1 GET:/ headers: "sec-websocket-key": "xF6wrL8RlOLLKxti+1r4Hg==" "connection": "Upgrade" "sec-websocket-version": "13" "sec-websocket-extensions": "permessage-deflate; client_max_window_bits" "upgrade": "websocket" "sec-websocket-protocol": "mqtt" "host": "192.168.2.47:8883" and payload Stream(PayloadDecoder { kind: Cell { value: Eof } }) [2023-08-25T04:59:59Z DEBUG ntex_io::ioref] unregister keep-alive timeout [2023-08-25T04:59:59Z TRACE ntex::http::h1::dispatcher] prep io for upgrade handler [2023-08-25T04:59:59Z TRACE ntex::http::h1::dispatcher] switching to upgrade service for Request HTTP/1.1 GET:/ headers: "sec-websocket-key": "xF6wrL8RlOLLKxti+1r4Hg==" "connection": "Upgrade" "sec-websocket-version": "13" "sec-websocket-extensions": "permessage-deflate; client_max_window_bits" "upgrade": "websocket" "sec-websocket-protocol": "mqtt" "host": "192.168.2.47:8883"

[2023-08-25T04:59:59Z DEBUG ntex_io::ioref] unregister keep-alive timeout [2023-08-25T04:59:59Z DEBUG ntex_io::ioref] unregister keep-alive timeout [2023-08-25T04:59:59Z TRACE ntex_io::io] not enough data to decode next frame [2023-08-25T04:59:59Z TRACE ntex_tokio::io] tcp stream is disconnected [2023-08-25T04:59:59Z TRACE ntex_tokio::io] write task is instructed to terminate [2023-08-25T04:59:59Z DEBUG ntex_io::ioref] unregister keep-alive timeout [2023-08-25T04:59:59Z TRACE ntex_io::io] io is dropped, force stopping io streams IO_STOPPED | IO_STOPPING | IO_STOPPING_FILTERS | WR_PAUSED | KEEPALIVE [2023-08-25T04:59:59Z TRACE ntex_io::ioref] force close io stream object `

diablur avatar Aug 25 '23 05:08 diablur