Last active
December 27, 2015 20:09
-
-
Save supershabam/7382596 to your computer and use it in GitHub Desktop.
A browser using PolySocket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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