diff --git a/example/app.py b/example/app.py index 24c464e..a28b615 100644 --- a/example/app.py +++ b/example/app.py @@ -11,7 +11,7 @@ async_mode = None app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' -socketio = SocketIO(app, async_mode=async_mode) +socketio = SocketIO(app, async_mode=async_mode, logger=True, engineio_logger=True) thread = None thread_lock = Lock() @@ -81,6 +81,13 @@ def my_room_event(message): to=message['room']) +@socketio.on('*') +def catch_all(event, data): + session['receive_count'] = session.get('receive_count', 0) + 1 + emit('my_response', + {'data': [event, data], 'count': session['receive_count']}) + + @socketio.event def disconnect_request(): @copy_current_request_context diff --git a/example/templates/index.html b/example/templates/index.html index fa97cb3..011e23c 100644 --- a/example/templates/index.html +++ b/example/templates/index.html @@ -3,7 +3,7 @@