It is mostly based on the WebSocket API.
It differs greatly from the Qt API (https://doc.qt.io/qt-5/qml-qtwebsockets-websocket.html).
I'm still unsure if we should directly provide connect/close or instead use a property to connect/close as the Qt API (called active).
Changing the API shouldn't be an issue since the old implementation was broken (this._socket was undefined).
The old API was inconsistent, send didn't call JSON.stringify() but onMessage called JSON.parse(), therefore I dropped it.
It is mostly based on the WebSocket API. It differs greatly from the Qt API (https://doc.qt.io/qt-5/qml-qtwebsockets-websocket.html). I'm still unsure if we should directly provide connect/close or instead use a property to connect/close as the Qt API (called active). Changing the API shouldn't be an issue since the old implementation was broken (this._socket was undefined). The old API was inconsistent, send didn't call JSON.stringify() but onMessage called JSON.parse(), therefore I dropped it.