You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
426 B

import messages, { decode } from "./network/messages";
const url = "ws://localhost:9000";
const protocols = ["odyssey-1-unstable"];
const webSocket = new WebSocket(url, protocols);
webSocket.binaryType = "arraybuffer";
webSocket.onopen = function (event) {
console.log(event);
webSocket.send(messages.Hello());
};
webSocket.onmessage = function (ev) {
const data = decode(ev.data);
console.log("Received ", data);
};