Skip to content

Instantly share code, notes, and snippets.

@supershabam
Last active December 27, 2015 20:09
Show Gist options
  • Save supershabam/7382596 to your computer and use it in GitHub Desktop.
Save supershabam/7382596 to your computer and use it in GitHub Desktop.
A browser using PolySocket
<!DOCTYPE html>
<html>
<head>
<script src='//polysocket.io/polysocket.js'></script>
<script>
// PolySocket behaves exactly like a WebSocket
// http://www.html5rocks.com/en/tutorials/websockets/basics/
var ps = new PolySocket('ws://node.remysharp.com:8001/')
ps.onmessage = function(data) {
console.log(data)
}
ps.onopen = function() {
ps.send('test')
}
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment