Files
arduinoWebSockets/tests/webSocket.html
Markus Sattler e1e6280e82 first working WebSocketClient
add LGPLv2.1
2015-05-24 15:40:47 +02:00

30 lines
571 B
HTML

<html>
<head>
<script>
var connection = new WebSocket('ws://10.11.2.1:81/test', ['arduino']);
connection.onopen = function () {
connection.send('Message from Browser to ESP8266 yay its Working!! ' + new Date());
connection.send('ping');
};
connection.onerror = function (error) {
console.log('WebSocket Error ', error);
};
connection.onmessage = function (e) {
console.log('Server: ', e.data);
};
setInterval(function() {
connection.send('Time: ' + new Date());
}, 1000);
</script>
</head>
<body>
Test Websocket.
</body>
</html>