FaC: Das alte Flag von Terminen, die in die Zeiterfassung übernommen worden sind, wird ebenfalls berücksichtigt.
20 lines
731 B
HTML
20 lines
731 B
HTML
<script src="./client.min.js"></script>
|
|
<script>
|
|
// this is usually just (to connect to the same origin):
|
|
// const socket = nanosocket()
|
|
const socket = nanosocket('wss://echo.websocket.org')
|
|
|
|
// log stream of incoming messages
|
|
socket.on('recv').map(d => console.log("recv", d))
|
|
|
|
// log all connection events
|
|
socket.on('connected').map(d => console.log("connected", d))
|
|
|
|
// log all disconnection events
|
|
socket.on('disconnected').map(d => console.log("disconnected", d))
|
|
|
|
// send a message
|
|
// note that this returns a promsie for when the message is actually sent
|
|
// since you can send when disconnected, and it will send after reconnecting etc
|
|
socket.send('boo').then(d => console.log("sent", d))
|
|
</script> |