rpikvm/templates/socketio.html
2020-06-05 16:14:56 +02:00

15 lines
491 B
HTML

<html>
<body>
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js" integrity="sha256-yr4fRk/GU1ehYJPAs8P4JlTgu0Hdsp4ZKrx8bDEDC3I=" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8">
var socket = io();
socket.on('connect', function() {
socket.emit('my event', {data: 'I\'m connected!'});
});
</script>
ahoj3
<input type="button" onClick="socket.emit('my event', 'test');" value="test" />
</body>
</html>