Files
arduinoWebSockets/tests/webSocket.html

30 lines
588 B
HTML
Raw Normal View History

<html>
<head>
<script>
2015-05-22 20:35:51 +02:00
var connection = new WebSocket('ws://10.11.2.1:81/test', ['esp8266']);
connection.onopen = function () {
2015-05-22 20:35:51 +02:00
connection.send('Message from Browser to ESP8266 yay its Working!!');
connection.send('ping');
};
connection.onerror = function (error) {
2015-05-22 20:35:51 +02:00
console.log('WebSocket Error ', error);
};
connection.onmessage = function (e) {
2015-05-22 20:35:51 +02:00
console.log('Server: ', e.data);
};
setInterval(function() {
connection.send('Message from Browser to ESP8266 yay its Working!!');
}, 10000);
</script>
</head>
<body>
Test Websocket.
</body>
</html>