27 lines
536 B
HTML
27 lines
536 B
HTML
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
</head>
|
||
|
<body>
|
||
|
<script>
|
||
|
let connection = new WebSocket("ws://localhost:8080/sensor-socket", ["access_token", "malusa"]);
|
||
|
console.log("***CREATED WEBSOCKET");
|
||
|
|
||
|
connection.onopen = function(evt) {
|
||
|
console.log("***ONOPEN", evt);
|
||
|
connection.send({ciao: "mamma"});
|
||
|
};
|
||
|
|
||
|
connection.onmessage = function(evt) {
|
||
|
console.log("***ONMESSAGE", evt);
|
||
|
};
|
||
|
|
||
|
connection.onerror = function(evt) {
|
||
|
console.error("***ONERROR", evt);
|
||
|
};
|
||
|
|
||
|
console.log("***CREATED all");
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|