mORMmot websocket and tms?

I just installed mORMot since I'm primarily using FPC, and need to get websockets working.

Using this as the base: https://github.com/synopse/mORMot/blob/master/SQLite3/Samples/31%20-%20WebSockets/Project31ChatServer.dpr

I've compiled and it's running, but TMS Websocket can't connect, with little debugging information other than "Firefox can?t establish a connection to the server at ws://localhost:8000/Project1/Project1.html"

The websocket server runs on localhost:8888, TMS on 8000, any advice or examples for setting up a connection?

Playing around with this more, I switched to this mORMot example: Simple Echo Server https://github.com/synopse/mORMot/blob/master/SQLite3/Samples/31%20-%20WebSockets/Project31SimpleEchoServer.dpr


Using the test page that comes with mORMot I've come to the conclusion that it has to do with the subprotocol, as in, the example mORMot implementation requires a subprotocol to be defined but I can't figure out how to add one with the TMS websocket (1.3.0.1)

I'm sorry but I'm not an expert in mormot.
We deliver a websocket server using Indy with the example. Maybe you can
1) try to compare with the indy based example we provide
2) get in touch with mormot to ask details about their server part

No need to be expert in mORMot, neither am I.


But I'd like to know why you haven't exposed the protocol setting for the connection?  Yes it's optional but is commonly used.

Is there a simple workaround for this so that I can add the protocol?

I can't edit posts, but I'm also talking to the mORMot guys about making the protocol setting optional.

So this turned  out to be super easy by just modifying the WebSocketClient unit.


I'm assuming you don't want me posting the full source code on this forum but I'd be happy to make a pull request somewhere if that'd be helpful.

All I did was make an extra property for protocol, set a default of blank string, and setting it when I connect.

There's also an issue with setting the Port number using the component editor when using Lazarus, the setting just doesn't take and it ends up using port 8000 unless I set it like in this connection block



  WebSocketClient1.Port := 8888;
  WebSocketClient1.Protocol := 'meow'; // From mORMot example
  WebSocketClient1.Connect;

Thanks for informing!

We'd be interested to incorporate the improvement.
You can get directly in touch to further discuss this.
https://www.tmssoftware.com/site/support_mail.asp
Thanks!