You are not logged in.
Pages: 1
Hello,
I'm planning to use Mormot in scenario similar to the chat demo 31. Clients send messages and Server should send it to all other clients.
So basically the only thing I need to do is make sure I don't send the message back to same client that sent it.
I suppose to do this I have to identify sessions, but I don't want full fledged authentication system, I only want each connection to get unique SessionID.
How would I go about doing this ?
Offline
Hi there ab,
I am interested in this also. How do I implement it? I am not using any authentication at all and my REST server is a memory server like this
fModel := TSQLModel.Create([], ROOT_NAME);
fRestServer := TSQLRestServerFullMemory.Create(fModel, false);
In addition, my interface methods have the following format:
function TRESTMethods.Partenaires(ID, List, DTO, Mfd, ContentType: RawUTF8): RawJSON;
var
Res: ISQLDBRows;
aObj: TSQLPartenaire;
Ctxt: TServiceRunningContext;
begin
Result := '';
//
if aServer.fDBProps = nil then
raise Exception.Create(SQLCONNECTIONINACTIVE);
// Set the current service context
Ctxt := CurrentServiceContext;
// Get/set the parameter values
UrlDecodeValue(Ctxt.Request.Parameters, 'id=', ID);
UrlDecodeValue(Ctxt.Request.Parameters, 'list=', List);
if List = EmptyStr
then List := 'Y';
UrlDecodeValue(Ctxt.Request.Parameters, 'dto=', DTO);
UrlDecodeValue(Ctxt.Request.Parameters, 'mfd=', Mfd);
if Mfd = EmptyStr
then Mfd := 'Non';
// REST OF THE CODE HERE
end;
Thanks a lot in advance.
JD
Last edited by JD (2018-11-21 20:41:59)
Offline
Why are you marshaling by hand the parameters?
Because at one time, the values sent by the client did not seem to be getting to the server. Why? I don't know. So I inserted all the UrlDecodeValue code to test it and I kind of left it like that. It works OK now though.
JD
Last edited by JD (2018-11-22 12:53:43)
Offline
Pages: 1