Last active
May 12, 2016 04:13
-
-
Save kmcheung12/3ec2662232684b909d143c9700a00c3e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 type="text/javascript"> | |
| var ws = new WebSocket("ws://127.0.0.1:8080/websocket"); | |
| ws.onopen = function() { | |
| setInterval(send, 3000, ws); | |
| }; | |
| function send(websocket) { | |
| websocket.send(Math.random()); | |
| } | |
| ws.onmessage = function (evt) { | |
| console.log(evt.data); | |
| }; | |
| </script> | |
| </head> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment