Add http backend#202
Conversation
|
This is nearly done. Need some cleanup, and resolving some small todos. The server can take multiple clients, who each see the same rendered image. The stream is currently throttled by the slowest connection. Only one client is active: it determines the size of the canvas, and the controls the mouse etc. |
|
A review would be great. Otherwise I'll just merge this in a few days. |
Vipitis
left a comment
There was a problem hiding this comment.
I have no webdev experience, so I can't give any input on the core changes.
Managed to try it even with multiple clients. I am not sure what the timeout is, but if the active client tabs away it basically freezes the rendering - but it remains the active client.
Should there be some notice about the bidirectional nature by default? Because you might receive events from untrusted clients that could somehow be malicious (I am not sure how this would be exploited beyond a denial of service, by like requesting really large resolutions for example? or maybe a close event? - people will find a way).
finally an idea: what might be possible when running multiple backends at the same time? For example one "presenter" doing it locally while others observe via http (or like a frame server that encodes a video file to save/stream it)
Co-authored-by: Jan <Vipitis@users.noreply.github.com>
Right, if the active client tabs away, the browser automatically scales down the animation loop, thereby slowing the animation. And since the active client determines the pace, the other clients get 1 fps or so too. I will add a note in the docs.
Authorization is the responsibility of the user. In practice, each user will have been authenticated, or connect via a magic link. That said, making another client the active one once the active client drops may not be acceptable behavior in many use-cases. I consider this a first experimental version; we'll have to flesh out details like that if/when this gets used in real-world scenarios. I will add some notes about this too.
Although it sounds like an interesting use-case, I suspect that most ppl would simply open a Google Meet 😅 I recon you're also thinking of #102, as in having a primary canvas and then a secondary to stream / watch along. |

A backend that runs a webserver that you can connect to with your browser. Multiple clients are supported (eventually).
Using ASGI, so it can run on any ASGI server and we don't have any hard dependencies 🚀
WIP AFM host code, saving here for reference, but I think I'll skip the afm: