[Lazarus] fpWeb and server-sent events

Michael Van Canneyt michael at freepascal.org
Wed Jun 3 16:52:34 CEST 2020



On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote:

> El 3/6/20 a les 15:54, Michael Van Canneyt via lazarus ha escrit:
>> 
>> 
>> On Wed, 3 Jun 2020, Luca Olivetti via lazarus wrote:
>> 
>>> Hello,
>>>
>>> I need to embed a simple web server in my application that
>>>
>>> 1) should server a couple of static files
>>> 2) send server-sent events
>>>
>>> 
> https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events 
>>>
>>>
>>>
>>> I can see that 1) is easy, but 2) I cannot see how (fpWeb model 
>>> doesn't seem to allow to take over the socket and keep sending data on 
>>> it).
>>> I saw an old message regarding websockets and bauglir-websocket but it 
>>> seems it implements a different server and I'd like to run everything 
>>> from the same socket.
>> 
>> Simply said: You can't in FPC.
>> 
>> The only way to do this with FPC is using websockets, indeed using
>> bauglir-websocket. I use it myself like that.
>
> I didn't look into it too much, but does it also serve "normal" http? If 
> so I could adapt it to manage events (after all it's much simpler than 
> websockets).

No, it does not serve normal http.


Michael.


More information about the lazarus mailing list