im currently building a flask application which uses websockets. For this i would like to use the flask-socketio library. I have copied the client example as per the docs instructions:
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script>
<script type="text/javascript" charset="utf-8">
var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('connect', function() {
socket.emit('hello', {data: 'Hello there!'});
});
</script>
and a simple server side handler:
@socketio.on('hello')
def handle_hello(message):
print message
however i get the following error in the borwserwindow console:
Uncaught TypeError: Cannot read the property 'onClose' of null.
Anybody know what im doing wrong here?