#1 Re: mORMot 1 » Websocket subprotocol » 2020-03-01 03:19:24

I've fixed the issue by updating the TMS package to include a sub-protocol, but I'll open a request for improvement to update the websocket implementation to allow to not use the optional sub-protocol parameter, along with an updated example since the current one isn't running for me (The second one that doesn't include a sub-protocol)

#2 Re: mORMot 1 » Websocket subprotocol » 2020-02-29 21:53:03

How do I set the protocol using the URI?

Looking at the example html, it shows two versions, the second including an empty protocol string, which results an error on connection.

socket = new WebSocket("ws://localhost:8888","");
SyntaxError: Failed to construct 'WebSocket': The subprotocol '' is invalid.

If I remove the second parameter, the subprotocol, I get this error

socket = new WebSocket("ws://localhost:8888");
onerror - code:undefined, reason:undefined, wasClean:undefined, status:3
onclose - code:1006, reason:, wasClean:false, status:3

This is why I'm wondering if there's an easy way to ignore or not check for a protocol, as it's an optional parameter for websockets.  I'm also talking to TMS, asking them why they haven't exposed that setting.

#3 mORMot 1 » Websocket subprotocol » 2020-02-29 03:46:18

MarcusF
Replies: 3

Hello, I'm new to mORMot and trying to create a websocket server using the simpleechoserver as an example, connection to it from a TMS Web  Core websocket client.
https://github.com/synopse/mORMot/blob/ … Server.dpr

I'm running into an issue where I can't set a subprotocol in the TMS client, is there a simple way to ignore the subprotocol with mORMot websocket server?

protocol := TWebSocketProtocolEcho.Create('meow','');

#4 Re: mORMot 1 » mORMot package for Lazarus » 2017-08-18 14:44:39

I like the idea, but the file is not available.

Board footer

Powered by FluxBB