[Lazarus] FCL-Web updates/extensions
Michael Van Canneyt
michael at freepascal.org
Wed Sep 1 17:14:44 CEST 2021
On Wed, 1 Sep 2021, Luca Olivetti via lazarus wrote:
> El 1/9/21 a les 13:06, Michael Van Canneyt via lazarus ha escrit:
>>
>> - The websocket protocol support can be attached to the HTTP server. That
>> means you can initiate a websocket connection on the same port as the
>> HTTP
>> server is listening; the HTTP server will hand off the connection to the
>> websocket server using the upgrade mechanism. A server demo is
>> included as well.
>
> Having not seen the implementation, my questions are:
>
> 1) existing code will still work unmodified?
Yes.
> 2) specifically the hack for server-sent events I mentioned here
> https://lists.lazarus-ide.org/pipermail/lazarus/2020-June/238089.html
> will still work?
The pastebin link is down ?
>
> 1) I suppose is a given ;-), 2) I ask because you only mentioned
> websockets and not server-sent events.
Server events are normally done using HTTP/2, and this is planned.
I can't promise your code will still run, but since the server was modified
to keep connections alive indefinitely, I suppose that you should now be
able to handle server events even easier with the upgrade mechanism;
It's just a matter of deciding to 'upgrade' depending on the URL & headers
in the initial request. In case you try to take a shot at it and you
need help implementing it, let me know...
Michael.
More information about the lazarus
mailing list