#1 2026-02-05 09:58:57

okoba
Member
Registered: 2019-09-29
Posts: 128

How can I use long work websocket using JS.

Hello

I read the sample and it says I need to enable aWSAjax. I did but when try "wscat -c ws://127.0.0.1:8888/root" or "wscat -c ws://localhost:8888/whatever/" I get "error: Unexpected server response: 400".
And there is note that json protocol is for debugging!

To be clear, I want to have the long work server with mORMot and use it by a JS client.

Offline

#2 2026-02-06 08:59:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,405
Website

Re: How can I use long work websocket using JS.

You can use a custom WebSockets protocol, and JSON.

It works well.

Offline

#3 2026-02-06 14:21:59

okoba
Member
Registered: 2019-09-29
Posts: 128

Re: How can I use long work websocket using JS.

I do not know how it should be done. Is there any sample I can look at?

Offline

#4 Yesterday 07:09:13

Coldzer0
Member
From: ::1
Registered: 2018-08-31
Posts: 38
Website

Re: How can I use long work websocket using JS.

okoba wrote:

I do not know how it should be done. Is there any sample I can look at?

https://github.com/synopse/mORMot2/tree … ket_primer


Mac, Windows, Linux
FPC Trunk, Lazarus Trunk, Delphi 13.x Latest

Offline

Board footer

Powered by FluxBB