mirror of
https://github.com/fluencelabs/cosmos-hackathon-frontend
synced 2025-04-28 15:12:16 +00:00
25 lines
552 B
JavaScript
25 lines
552 B
JavaScript
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||
|
|
||
|
window.onload = function () {
|
||
|
console.log("hello to1")
|
||
|
};
|
||
|
|
||
|
let socket = new WebSocket("ws://ip:port");
|
||
|
|
||
|
socket.onopen = function(e) {
|
||
|
console.log("Waaaa ebsocket was opened: " + JSON.stringify(e));
|
||
|
|
||
|
};
|
||
|
|
||
|
socket.onmessage = function(event) {
|
||
|
console.log("Message was received: " + JSON.stringify(event))
|
||
|
};
|
||
|
|
||
|
socket.onclose = function(event) {
|
||
|
console.log("Websocket was closed. Cause: " + JSON.stringify(event))
|
||
|
};
|
||
|
|
||
|
socket.onerror = function(error) {
|
||
|
console.log("Error: " + JSON.stringify(error))
|
||
|
};
|