1<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js" integrity="sha256-yr4fRk/GU1ehYJPAs8P4JlTgu0Hdsp4ZKrx8bDEDC3I=" crossorigin="anonymous"></script>
2<script type="text/javascript" charset="utf-8">
3 var socket = io();
4 socket.on('connect', function() {
5 socket.emit('my event', {data: 'I\'m connected!'});
6 });
7</script>
8