# Flask Socket.io in plugin

**URL:** <https://talk.getindico.io/t/flask-socket-io-in-plugin/2603>\
**Category:** Plugin Development\
**Created:** [March 4, 2022, 5:18pm UTC](https://talk.getindico.io/t/flask-socket-io-in-plugin/2603 "2022-03-04T17:18:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![donjus](https://talk.getindico.io/user_avatar/talk.getindico.io/donjus/32/897_2.png) [@donjus](https://talk.getindico.io/u/donjus)\
**Post date:** [March 4, 2022, 5:18pm UTC](https://talk.getindico.io/t/flask-socket-io-in-plugin/2603/1 "2022-03-04T17:18:41Z")

</div>

Have you already tried to integrate Flask [socket.io](http://socket.io) into the Indico system? Especially when developing a plugin?

If yes, is there a special procedure?

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [March 4, 2022, 5:23pm UTC](https://talk.getindico.io/t/flask-socket-io-in-plugin/2603/2 "2022-03-04T17:23:11Z")

</div>

No, we haven’t tried that yet and don’t plan to since AFAIK it “wastes” one uWSGI worker slot for each active connection.

Assuming you only need to send push messages but not have an actual bidirectional websocket connections, maybe using this uWSGI magic could help - in fact this is what I’d probably add to Indico as soon as we have a usecase for it:

> **[GitHub - ThiefMaster/uwsgi-flask-sse-offload-test: Demo for uWSGI's...](https://github.com/ThiefMaster/uwsgi-flask-sse-offload-test)**
>
> Demo for uWSGI's offloading feature used with Flask and SSE - GitHub - ThiefMaster/uwsgi-flask-sse-offload-test: Demo for uWSGI's offloading feature used with Flask and SSE

The idea there is to have a tiny WSGI app that’s offloaded to uWSGI and then using redis’ pub-sub feature to send messages to it.

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [March 4, 2022, 5:24pm UTC](https://talk.getindico.io/t/flask-socket-io-in-plugin/2603/3 "2022-03-04T17:24:31Z")

</div>

I remember seeing something about “chat” in one of your previous questions… if you develop an event chat I’d seriously consider splitting the actual chat functionality in a separate webapp and making the plugin just embed it. That way you don’t have to add all this complexity to Indico itself.
