The problem was that I was using close codes 1000-1015 and QWebsocket appeared to be disagreeing with their usage and reported 1002, probably because they were being misused. The solution was to just use close codes in the 4000+ range.
The problem was that I was using close codes 1000-1015 and QWebsocket appeared to be disagreeing with their usage and reported 1002, probably because they were being misused. The solution was to just use close codes in the 4000+ range.
There could be a discrepancy in how the server (uWS) and the client (Qt's QWebSocket) interpret the WebSocket close frames. Ensure that the server is sending a well-formed close frame according to the WebSocket RFC!
You can check the exact frame being sent by the server (using tools like Wireshark or the browser's WebSocket debugging tools) to ensure that the close code and reason are being sent correctly.
getaway shootout
You can try enabling debugging or logging for WebSocket frames to see if there are any anomalies in the connection close process. Check the QWebSocket debug output (or even modify the Qt source if you're building from source) to inspect the raw frames being received and processed by the client.
Bookmarks