WebSocket not receiving anymore updates after initial connection
WebSocket not receiving anymore updates after initial connection

GodotRevolt/src/DESKTOP/scenes/Websocket.gd at main

Godot web socket client is not receiving anymore updates from Revolt web socket server (https://developers.revolt.chat/stack/bonfire/establishing) after first data is received
first data is an Authentication success message:
{ "type": "Authenticated" }
This success message comes when a successful token is received.
Since there are no updates and you cannot send any data after initial connection (data_received never called again, so put_packet() not working apparently), the token will have to be in query parameters:
wss://ws.revolt.chat/?version=1&format=json&token={token}
in order to even receive that success message.
An issue relating to web sockets was opened: https://github.com/godotengine/godot/issues/27560
The user claims that one of the headers causes the connection to cease.
The problem header is Connection: close, Upgrade
GET / HTTP/1.1 Pragma: no-cache Cache-Control: no-cache Host: echo.websocket.org Upgrade: websocket Connection: close, Upgrade Sec-WebSocket-Key: HKWU1xOVV6PP6HXjcIWMDQ== Sec-WebSocket-Version: 13 HTTP/1.1 101 Web Socket Protocol Handshake Connection: Upgrade Date: Sun, 31 Mar 2019 19:09:01 GMT Sec-WebSocket-Accept: 0IHc3riAKJz52YmkLVcWrDHvaYs= Server: Kaazing Gateway Upgrade: websocket
IMPORTANT!!
What SHOULD happen and what happens on other clients like websocketking, piehost, or this one is receiving a READY
update
the big issue:
connect_to_url()
is the only thing that sends data or the connection closes or a protocol error
It would be of great help if anyone could give any little piece of knowledge or suggestion on this. code
UPDATE
I posted this before testing out an older version of godot and it seems to work just great! But as in the github issue, that is because of changes with how the protocols worked and what headers are sent!
Here is the code for use in Godot 3.1.1: