Hi. I have a Web Core app using TWebSocketClient to connect to a TTMSWebSocketServer in a Delphi server program. Each side sends plain text to each other.
I've done this before and haven't had any issues, but now when the web client receives a message it sees "[object Object]" instead of the actual message text. Messages the other way get through as expected.
At the server, the message is sent with:
WebSocketServer.BroadcastMessage('some message');
At the web client, the code is:
procedure TForm1.WebSocketClient1DataReceived(Sender: TObject; Origin: string;
Data: TJSObject);
var
s: String;
begin
s := Data.toString;
WebMemo1.Lines.Add(s);
end;
Regardless of what text is sent, it always displays as "[object Object]".
I'm using Web Core V1.5.6.0 and Delphi Ent 10.2.3.
I've tested the server using an online websocket checker (https://www.websocket.org/echo.html) and that shows the text messages as expected, so my issue seems to be with the web app side.
Dave