Support for Django Channels in OMERO.web for websockets

I notice that there is WebSocket support for OMERO.server.
https://docs.openmicroscopy.org/omero/5.6.0/sysadmins/websockets.html

Out of curiosity, is there WebSocket support for OMERO.web? The reason why I ask is because OMERO.web is Django server and Django provides the “Channels” Django app which provides WebSocket support. This is really useful for real-time web applications where clients are collaboratively annotating slides, …etc.

However it seems like developers can only configure Channels at the root application level and cannot configure Channels at the plugin level (i.e. must modify the OMERO.web codebase directly). For example developers need to set ASGI_APPLICATION and CHANNEL_LAYERS and create a bunch of boilerplate using channels.routing inside OMERO.web.

If not, is there any plan / intention for WebSocket support for OMERO.web?

Channels documentation:
https://channels.readthedocs.io

Hi! We added websocket support to OMERO.server to help workaround restrictive firewalls that only allowed http/https. We don’t have any plans to add support in OMERO.web, although it’s potentially a very nice thing to have.

We’re happy to review PRs though, so if you’re writing your own app but require some changes to the core OMERO.web to support that we’re happy to help. If your PR is more than a few lines it might be best for you to open a GitHub issue first so you don’t waste time writing code that can’t be accepted.

Hi @manics, I would be happy to work on the websocket support for OMERO.web or see if there is someone to work on the support. I think I did some prototyping a few months ago for it which seemed to work.

That said the changes may require some big additions for security. OME / our lab will need to come up with login handlers like omeroweb.webclient.decorators.login_required for websockets and tests around that.

It’s great that you can devote some developer time! Do you have a link to your prototype? If not can you say a bit more about your use-cases? That should help us agree on a design before you start opening PRs.