Skip to content

Instantly share code, notes, and snippets.

@fieldAbyss
Last active March 4, 2018 05:11
Show Gist options
  • Save fieldAbyss/1128a25f5d1ff69631c63b55699e4cad to your computer and use it in GitHub Desktop.
Save fieldAbyss/1128a25f5d1ff69631c63b55699e4cad to your computer and use it in GitHub Desktop.
Client (index.html) ES6 .ver URL:github-gist
<script src="/socket.io/socket.io.js"></script>
<script>
const socket = io.connect('http://localhost');
socket.on('news', (data) => {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment