I am trying to listen to new socketIO connections on the user's id namespace. The user ID is stored in the flask session object.
@socketio.on('connect', namespace=session['userId'])
def test_connect():
emit('newMessage')
This code is producing the following error:
raise RuntimeError('working outside of request context')
How can I get the above connect listener to run within the request context?
Thanks!