Skip to content
Snippets Groups Projects
Commit e0713cd7 authored by Sami Spets's avatar Sami Spets
Browse files

.

parent 704f4d41
No related branches found
No related tags found
No related merge requests found
Pipeline #15998 passed
......@@ -10,6 +10,6 @@
</body>
<script src="./js/lib/libde265.min.js"></script>
<script src="./js/lib/msgpack5.min.js"></script>
<script src="../peer.js"></script>
<script type="application/javascript" src="./../peer.js"></script>
<script src="./js/index.js"></script>
</html>
\ No newline at end of file
......@@ -132,7 +132,7 @@ const createCard = (url, viewers) => {
const connectToStream = () => {
const ws = new WebSocket('ws://localhost:8080/');
let p = new Peer(ws);
p.send('connect', [0,'__handshake__'])
p.send('message', ([0,'__handshake__']));
current_data.frames = 10;
//setTimeout 1s, ask for the amount of frames user has selected
......
......@@ -6,6 +6,10 @@ const kConnecting = 1;
const kConnected = 2;
const kDisconnected = 3;
// Generate a unique id for this webservice
// let my_uuid = new Uint8Array(16);
// my_uuid[0] = 44;
// my_uuid = Buffer.from(my_uuid);
const kMagic = 0x0009340053640912;
const kVersion = 0;
......@@ -29,7 +33,9 @@ function Peer(ws) {
this.name = "unknown";
this.master = false;
this.sock.on("message", (raw) => {
console.log(this.sock.send("message"));
this.sock.send("message", (raw) => {
// console.log(raw)
let msg = decode(raw);
console.log("MSG", msg)
......@@ -77,9 +83,10 @@ function Peer(ws) {
}
});
this.send("__handshake__", kMagic, kVersion);
this.send("__handshake__", kMagic, kVersion, /*[my_uuid]*/);
}
// Peer.uuid = my_uuid;
/**
* @private
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment