- document.addEventListener('DOMContentLoaded', (event) => {
- const wsock = new WebSocket(`${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`)
- wsock.onopen = () => {
- console.log(`Strapped to ${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`)
- }
- wsock.onmessage = (evt) => {
- console.log("Incoming connection from " + evt.data)
- console.log("TODO: Open a socket to this client")
- wsock.send("Got " + evt.data)
- clients.push({
- ip: evt.data,
- dataChannel: undefined
- })
- }
- })
+ const wsock = new WebSocket(`${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`)
+ wsock.onopen = () => {
+ console.log(`Strapped to ${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`)
+ }
+ wsock.onmessage = (evt) => {
+ console.log("Incoming connection from " + evt.data)
+ console.log("TODO: Open a socket to this client")
+ wsock.send("Got " + evt.data)
+ clients.push({
+ ip: evt.data,
+ dataChannel: undefined
+ })
+ }