You are not logged in.
Pages: 1
Can someone help me how to implement \Samples\31 - WebSockets to work on web together with delphi client?
I tried postman:
ws://localhost:8888/root/LongWorkCallback.WorkFinished
Request URL: http://localhost:8888/root/LongWorkCallback.WorkFinished
Request Method: GET
Status Code: 400 WebSocket Upgrade Error
I have no idea how to start the websocket listener that will handle particular events.
Offline
The protocol used is an encapsulation of REST over the WebSockets frames, in both directions.
So the URL is not a "postman" URI.
So, you can't use interface callbacks with a Web client.
Define your own protocol, then use a frame to notify the client from the server. But you won't be able to do it directly from an interface.
It may be feasible to make a Web client compatible with the mORMot REST encapsulation, but it is somewhat complex.
There is a full query/answer pattern added to the WS frames limited layout.
The reference code is TWebSocketProtocolJson.FrameDecompress/FrameDecompress as used by the TWebSocketProtocolRest class.
Online
Pages: 1