I use python websocket-client to send message to client.
On client side I have:
var s = new WebSocket('http://' + location.host + ':8000/ws');
s.onopen = function(e) {
$("#connected3").html('open');
console.log(e)
}
s.onclose = function(e) {
$("#connected").html('close')
}
s.onmessage = function(e) {
$("#connected2").html(e.data);
}
and on server side I have:
import websocket
ws = websocket.WebSocket()
ws = create_connection("ws://127.0.0.1:8000/ws", sslopt= {"check_hostname": False})
I get this error: Handshake status 404
My guess is, there is a problem with web socket server: ws://127.0.0.1:8000/ws
Did I miss something in setting up my web socket?
Full code: https://github.com/Homa/weatherApp