1 document
.title
= "Strapp.io Host"
3 if ("WebSocket" in window
) {
4 document
.addEventListener('DOMContentLoaded', (event
) => {
5 const wsock
= new WebSocket("wss://" + window
.location
.host
+ ":" + _strapp_port
)
7 console
.log("Strapped to wss://" + window
.location
.host
+ ":" + _strapp_port
)
9 wsock
.onmessage
= (evt
) => {
10 console
.log("Incoming connection from " + evt
.data
)
11 console
.log("TODO: Open a socket to this client")
12 wsock
.send("Got " + evt
.data
)
15 dataChannel
: undefined
21 document
.addEventListener('DOMContentLoaded', () => {
22 document
.body
.innerHTML
= 'Websockets not supported in your browser'