1 document
.title
= "Strapp.io Host"
3 if ("WebSocket" in window
) {
4 const wsock
= new WebSocket(`${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`)
6 console
.log(`Strapped to ${_strapp_protocol}://${window.location.hostname}:${_strapp_port}`)
8 wsock
.onmessage
= (evt
) => {
9 console
.log("Incoming connection from " + evt
.data
)
10 console
.log("TODO: Open a socket to this client")
11 wsock
.send("Got " + evt
.data
)
14 dataChannel
: undefined
19 document
.addEventListener('DOMContentLoaded', () => {
20 document
.body
.innerHTML
= 'Websockets not supported in your browser'