#1 2021-09-30 17:25:38

rareMax
Member
From: Ukraine
Registered: 2021-06-06
Posts: 3

Send and Receive messages via WebSocket in mORMot2

I try connect to server with this code: https://gist.github.com/ms301/fc7f7e350 … 12f1d64ab4

How to correct way to send and receive messages via Websocket?

Offline

#2 2021-09-30 19:05:45

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,539
Website

Re: Send and Receive messages via WebSocket in mORMot2

There is a samples in https://github.com/synopse/mORMot/tree/ … WebSockets
They for mORMot1, but the idea is the same in mORMot2.
Hope it's help

Offline

#3 2021-09-30 20:06:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: Send and Receive messages via WebSocket in mORMot2

TWebSocketProtocolRest is a very specific protocol, used only internally by mORMot between mORMot clients and server, which supports a bi-directional REST emulation on both sides.
So I guess this is not what you need.

Check the mORMot 1 most simple samples, like Project31SimpleEchoServer.dpr.
What you expect is likely to be much closer to a raw protocol like the chat protocol.

Offline

#4 2021-09-30 22:27:04

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Send and Receive messages via WebSocket in mORMot2

I have converted Project31SimpleEchoServer to mormot2 to do some tests:
https://github.com/devaex/ClientServerWebSocketSample

Offline

Board footer

Powered by FluxBB