Open theonardo23 opened 3 years ago
The same for me. OnMessage was never triggered.
Same problem here, the websocket connection establishes successfully, and Chrome dev tools show incoming websocket messages, but OnMessage is never triggered (tested in Chrome, Firefox). This Problem only arises on a WebGL Build, UnityEditor and Windows Build working fine.
Try fixing it by replacing
Module['dynCall_viii']( webSocketState.onMessage, [instanceId, buffer, dataBuffer.length]);
to
Module['dynCall_viii']( webSocketState.onMessage, instanceId, buffer, dataBuffer.length);
in WebSocket.jslib
in ~168 and 182
lines
Try fixing it by replacing
Module['dynCall_viii']( webSocketState.onMessage, [instanceId, buffer, dataBuffer.length]);
toModule['dynCall_viii']( webSocketState.onMessage, instanceId, buffer, dataBuffer.length);
inWebSocket.jslib
in~168 and 182
lines
this worked for me.
Everything is working great on the Build version except the OnMessage trigger.
It shows the log when connection is established, and my server can read the message sent from it. Only when I responded from my server side by sending or by broadcasting message, it triggered OnMessage the client that was running on my Unity Game Player but it never triggered the OnMessage on my build.
I'm using the build and run option on unity, so the build is running on localhost & as for the backend it's running on a remote server