Websocketserver with Flask and gevent in Python
You can call the ws = environ["wsgi.websocket"] to pull up the websocket interface anywhere in your application.
I have a WebSocketServer with Flask and gevent. I have my own WebsocketApplication inheriting from WebSocketApplication in which I overrite on_open(), on_close(), on_message() and it's working fine. I also have a Method broadcast_message() to send a message to all clients, which is working fine as well.  Now I need to call broadcast_message() from outside my WebSocketApplication (e.g. when a special site is visited), but I didn't find any way to do this.  I am using Python 3.5.