You are not logged in.
Pages: 1
Okay. Thanks for the clarification.
I am a newbie, and I wanted my server (TWebSocketServer), to have communication via websockets, at the same time for clients "html" and mORMOt clients.
Hi,
@ab Thanks for all your work.
It's amazing.
I have FPC and I have tried TWebSocketServer.WebSocketBroadcast(), with several "html" clients and it works very well. Excellent!
I would like not only to have websockets clients "html", but also to add clients made with mORMot.
I tried to do it with "THttpClientWebSockets" but I do not know how to use it.
I appreciate some guidance.
Thanks turrican,
Interesting analysis you have done.
I confirm that making the change you have put in "ProcessHandshake" with "Result: = true;"
It works correctly in the web browser: "Chrome" but still does not work with "Microsoft Edge"
When comparing the SynBidirSock.pas files of the current version with the October (Works in all web browsers):
The parts of the code you have published do not exist in the October version.
Solved by this way : http://pastebin.com/UrMHSneL
Another question... Chrome and Firefox returns a 401 and 400 when try to access : http://localhost:8888/whatever/
IExplorer goes well.
If you compile with mORMot versions of October or earlier, it works correctly on all web browsers: Chrome, Firefox ... etc
That's what I tried to say here:
https://synopse.info/forum/viewtopic.php?id=3747
Please @ab , you could check it.
I am in the example "31 - WebSockets", specifically:
"Project31SimpleEchoServer"
If I compile with Mormot versions of October or before, everything works OK.
But when compiling with the latest versions of Mormot,
Opening "Project31SimpleEchoServer.html" does not detect it.
I hope I can provide some help.
Best regards.
Congratulations on this. Excellent job @hnb, @AOG @ab and all his team Mormot .
When compiling with build mode Win32
DDD shared units
failed
Optimization changing levels of 2 ( -O2 ) to 1 ( -O1 ) everything is OK .
That's great!
Cordially
Reynaldo
Hello EMartin,
You could share your complete solution ?
I do not understand is what your class " TCCAgentWS " ...
I appreciate all the guidance you can provide .
I solved this saving reference from TWebSocketProtocolChat and THttpServerResp:
// protocol class implementation TCCAgentWSProtocol = class(TWebSocketProtocolChat) protected procedure ProcessFrame(Sender: THttpServerResp; const Frame: TWebSocketFrame); public CCAgentWS: TCCAgentWS; // my class using websocket protocol class end; // ProcessFrame implementation procedure TCCAgentWSProtocol.ProcessFrame(Sender: THttpServerResp; const Frame: TWebSocketFrame); begin case Frame.opcode of focContinuation: begin CCAgentWS.fWSProtocol := Self; CCAgentWS.fWSHttpServerResp := Sender; end; focConnectionClose: begin CCAgentWS.fWSProtocol := Nil; CCAgentWS.fWSHttpServerResp := Nil; end; ... end; end;
It is not a mORMot solution but "it is what it is".
Thanks.
Pages: 1