You are not logged in.
Pages: 1
Hi all,
SHORT:
Q1) Best server/client setup in mORMot2 for secure Server[Winx64]/Client[FMX Android].
Q2) How to wire-up 3rd party WebSocket client-component into mORMot2?
LONG:
Q1)I need to start a new multi-platform (Win/Android) Client app in Firemonkey, server running on Windows.
I've been trying to get WebSockets working with mORMot1 Android, installed Certificates and have bought latest scgWebsockets license for an Android WebSockets client.
Coming here for help, I discovered mORMot2! Congrats and thank you! So it makes me think if some new development might make a difference here.
The app's storage+network must be fully encrypted (preferably end-to-end for net) and async WebSockets would be ideal, with the usual mORMot TRest and InterfacedBasedServices.
All clients will be mORMot compiled for Win/Android/macOs.
What would be the recommended secure server/client setup be, especially for Android?
I've read before that one need to compile mORMot's WebSocket client in Larazus which can be used in Delphi FMX/Android? Is this still the case?
Q2) Alternatively; How can I 'wire-up' scgWebsocketClient in Android so the rest of my code work with a TRest mORMot class/intf as usual?
Thanks, hope it make sense.
Last edited by AntonE (2021-03-03 03:48:37)
Offline
SHORT:
Q1) HTTPS using http.sys on the server
Q2) Use the AJAX JSON protocol on the server side, then it will be easily consumed by any WS client.
See TWebSocketProtocolJson.FrameCompress/FrameDecompress in mormot.ws.core.pas for the raw JSON format, and how it is used in TWebSocketProtocolRest.InputToFrame/FrameToOutput:
FrameCompress(head, [{%H-}Method, Ctxt.Url, Ctxt.InHeaders, ord(aNoAnswer)],
Ctxt.InContent, InContentType{%H-}, request);
...
FrameCompress(outhead, [Status, Ctxt.OutCustomHeaders], Ctxt.OutContent,
OutContentType{%H-}, answer);
Then the internal JSON of Ctxt.InContent/Ctxt.OutContent will follow the regular mORMot JSON serialization of the REST requests, as defined in the doc.
The interface callbacks indeed share the very same JSON layout: it is a regular REST JSON Call, just from server to client.
Online
I tried synrestdataset on lazarus LAMW, had no luck, need more times to tame this mormot -> i'm gonna use dart/js sample provided by ab translate into LAMW httpclient.
By the way your sample (antonE) on LAMW not work on latest LAMW, eror on creating server. 1 year ago was fine.
Last edited by mongkey (2021-09-08 10:35:44)
Offline
All work for now on LAMW, flutter, need dig deeper on mormot security, thank you AB!
Offline
It would be nice if you could share the changes that were needed to get things working again.
Thanks !
Offline
Pages: 1