Skip to content

Instantly share code, notes, and snippets.

@pomle
Last active August 29, 2017 20:12
Show Gist options
  • Save pomle/414187323c6fdb0a08bf0c82139e3378 to your computer and use it in GitHub Desktop.
Save pomle/414187323c6fdb0a08bf0c82139e3378 to your computer and use it in GitHub Desktop.
<script src="http://cdn.snex.io/snex.latest.min.js"></script>
<script type="text/javascript">
snex.createSession()
.then(session => {
session.on('connection', conn => {
console.log('Player joined!');
conn.on('data', data => {
console.log('Player signal', data);
});
});
return session.createURL('nes');
})
.then(link => {
// Prints "Go to http://snex.io/XAGE to play!"
console.log(`Go to ${link.url} to play!`);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment