Код: Выделить всё
#!/php -q
Код: Выделить всё
var connection = new WebSocket('ws://localhost:12345');
connection.onopen = function () {
connection.send('Ping'); // Send the message 'Ping' to the server
};
// Log errors
connection.onerror = function (error) {
console.log('WebSocket Error ' + error);
};
// Log messages from the server
connection.onmessage = function (e) {
console.log('Server: ' + e.data);
};
Firefox не может установить соединение с сервером по адресу ws://localhost:12345/.
Подробнее здесь: https://stackoverflow.com/questions/145 ... ver-in-php
Мобильная версия