私はpython websocket-clientを使ってクライアントにメッセージを送ります。python websocket 404 on Handshake
私はクライアント側で:私が持っている
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);
}
と、サーバー側で:
import websocket
ws = websocket.WebSocket()
ws = create_connection("ws://127.0.0.1:8000/ws", sslopt= {"check_hostname": False})
私はこのエラーを取得する: ハンドシェイクのステータス404
私の推測ではあるがあり、 Webソケットサーバーの問題: ws://127.0.0.1:8000/ws
ウェブソケットの設定に何か不足しましたか?
全コード: https://github.com/Homa/weatherApp