Can not communicate between Python and angular through socketIO
I am using flask-socketIO to communicate between server and Angular front end.I am using the following settings for flask
app = Flask(_name_) app.config['DEFAULT_PARSERS'] = [ 'flask.ext.api.parsers.JSONParser', 'flask.ext.api.parsers.URLEncodedParser', 'flask.ext.api.parsers.FormParser', 'flask.ext.api.parsers.MultiPartParser' ] CORS(app) app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app,async_mode=None) SocketIO(app,cors_allowed_origins="*")
socketIO for connection request is given below
@socketio.on('connect',namespace='/elobil') def test_connect(): print('[IO.EVENT]: Connected') global thread with thread_lock: if thread is None: thread = socketio.start_background_task(send_data_to_web) socketio.emit('my_status', {'conn_device': "dead",'conn_server': "live"}, namespace='/elobil') socketio.emit('my_data', {'data': {"power_status":"unknown"}}, namespace='/elobil')
on the console i am able to see a log inside onconnect.But the debug print inside my python tes_connect function is not printing Please Help