I am using flask-socketio and everything works awesome but when sending one value using emit, the chrome developer tools is showing error BUT EVERYTHING IS WORKING AS EXPECTED.
"WebSocket connection to 'ws://127.0.0.1:5000/socket.io/?EIO=3&transport=websocket&sid=240eada2f8bb4ce889ae90ffbf9cb6ea' failed: Invalid frame header"
Sending a value of input field is working fine but what I want to send is a substring of an input value. Have checked the type of the substring and it is string.
javascript :
value1=$('#input_box').val();
var term = value1.substr(value1.lastIndexOf("!") + 1);
socket.emit('qqq event',{data:term});
flask:
@socketio.on('qqq event', namespace='/test')
def my_event(term):
term=term['data']
emit('xyz',{'data':term})
With this code, the value is being sent to flask server but chrome shows error. As mentioned, Everything works but just curious to know the reason for error.
When I change the value to the value of the input field, error is not shown.