You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an async tcp socket is created and then later upgraded to a websocket - note - not using network_socket_ws(s) Gakemaker will send it's own Websocket continuation frames without the developer asking for it. While this may be acceptable and expected for network_socket_ws it should not occur when the socket is opened as network_socket_tcp then manually upgraded.
The effect of these automatically generated packets is to break some non-Gamemaker specific WS protocols. Of particular note is the widely used socket.io Node package. If handling the communications in code there is a very specific handshake protocol required by socket.io that is broken by Gamemaker's own continuation packets
Expected Change
Do not send any data unless socket is network_socket_ws/s
Steps To Reproduce
As this requires a functioning socket.io server I've got one running on http://piserv.co.uk. You can open this in a web browser and view interaction with the application below which also uses the same socket.io app (which is just an example from the socket.io repo)
Next you'll need WireShark to monitor the socket connection.
==== Website ====
Click the button marked Add User (the user is called Gamemaker)
Click the button marked Hello World
Note that your web browser has just listed the new added user and the Hello World message from (3) + (4)
Click the Upgrade button - anything you do past this point will cause GM to throw a Runtime Error (not caught the errors past here)
Now refer to WireShark
You will notice that the WebBrowser connects clean with the 101 upgrade followed by a running websocket with only the traffic between the browser and site showing.
HOWEVER - inspect the GameMaker 101 upgrade and you will see it is not clean with the upgrade being followed by a 2probe message from GM (I sent it) then an unwanted Websocket Continuation Frame - the websocket is marked as [Fragmented]. After this the website will immediately close the socket as the Continuation Frame breaks the socket.io protocol.
A little later you'll see me responding to a 3probe with a 5 (the 5 is the EngineIO Upgrade opcode) - however the websocket has already been closed because GM sent it's own Continuation Frame (I never do it...)
It may help to examine each session running by itself - run once only via web and a second time only via GM
Here's a sample from Wireshark
The 2probe is part of the handshake which GM breaks by adding a Continuation Frame
Owing to tracking this problem there are numerous show_debug_message() calls that show what's going on under the hood
The websocket connection is valid so if GM doesn't send it's Continuation Frame the protocol will complete successfully (then break later as more Frames will be needed once past this step). If the websocket connects properly then this issue is resolved (and further issues are my fault from not being able to get past this point)
How reliably can you recreate this issue using your steps above?
Always
Which version of GMRT are you reporting this issue for?
2024.8.1.218
Contact Us Package Attached?
I have attached my Contact Us Package
Sample Project Added?
I have included a small sample project
The text was updated successfully, but these errors were encountered:
YYDan
changed the title
GM sends it's own (unwanted) packets when an async TCP socket is upgraded to WebSockets
In-Game: network_socket_tcp() sockets have unwanted extra packets returned after upgrading manually to Socket.io websockets
Dec 9, 2024
Description
Further to Forums...
If an async tcp socket is created and then later upgraded to a websocket - note - not using network_socket_ws(s) Gakemaker will send it's own Websocket continuation frames without the developer asking for it. While this may be acceptable and expected for network_socket_ws it should not occur when the socket is opened as network_socket_tcp then manually upgraded.
The effect of these automatically generated packets is to break some non-Gamemaker specific WS protocols. Of particular note is the widely used socket.io Node package. If handling the communications in code there is a very specific handshake protocol required by socket.io that is broken by Gamemaker's own continuation packets
Expected Change
Do not send any data unless socket is network_socket_ws/s
Steps To Reproduce
As this requires a functioning socket.io server I've got one running on http://piserv.co.uk. You can open this in a web browser and view interaction with the application below which also uses the same socket.io app (which is just an example from the socket.io repo)
Next you'll need WireShark to monitor the socket connection.
==== Website ====
==== WireShark ====
==== Gamemaker ====
Now refer to WireShark
You will notice that the WebBrowser connects clean with the 101 upgrade followed by a running websocket with only the traffic between the browser and site showing.
HOWEVER - inspect the GameMaker 101 upgrade and you will see it is not clean with the upgrade being followed by a 2probe message from GM (I sent it) then an unwanted Websocket Continuation Frame - the websocket is marked as [Fragmented]. After this the website will immediately close the socket as the Continuation Frame breaks the socket.io protocol.
A little later you'll see me responding to a 3probe with a 5 (the 5 is the EngineIO Upgrade opcode) - however the websocket has already been closed because GM sent it's own Continuation Frame (I never do it...)
It may help to examine each session running by itself - run once only via web and a second time only via GM
Here's a sample from Wireshark
The 2probe is part of the handshake which GM breaks by adding a Continuation Frame
Owing to tracking this problem there are numerous show_debug_message() calls that show what's going on under the hood
The websocket connection is valid so if GM doesn't send it's Continuation Frame the protocol will complete successfully (then break later as more Frames will be needed once past this step). If the websocket connects properly then this issue is resolved (and further issues are my fault from not being able to get past this point)
How reliably can you recreate this issue using your steps above?
Always
Which version of GMRT are you reporting this issue for?
2024.8.1.218
Contact Us Package Attached?
Sample Project Added?
The text was updated successfully, but these errors were encountered: