backend/test.html

27 lines
536 B
HTML
Raw Normal View History

2020-03-11 15:23:58 +00:00
<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>