Что не так делаю ? Выдает ошибку WebSocket connection to 'ws://gtiradio.ru/count2.php' failed: Error during WebSocket handshake: Unexpected response code: 200
var socket = new WebSocket("ws://gtiradio.ru/count2.php");
socket.onopen = function() {
alert("Соединение установлено.");
};
socket.onclose = function(event) {
if (event.wasClean) {
alert('Соединение закрыто чисто');
} else {
alert('Обрыв соединения'); // например, "убит" процесс сервера
}
alert('Код: ' + event.code + ' причина: ' + event.reason);
};
socket.onmessage = function(event) {
alert("Получены данные " + event.data);
};
socket.onerror = function(error) {
alert("Ошибка " + error.message);
};