mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-13 07:16:31 +02:00
30 lines
588 B
HTML
30 lines
588 B
HTML
<html>
|
|
<head>
|
|
|
|
<script>
|
|
var connection = new WebSocket('ws://10.11.2.1:81/test', ['esp8266']);
|
|
|
|
connection.onopen = function () {
|
|
connection.send('Message from Browser to ESP8266 yay its Working!!');
|
|
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('Message from Browser to ESP8266 yay its Working!!');
|
|
}, 10000);
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
Test Websocket.
|
|
</body>
|
|
</html> |