Created
February 24, 2016 20:14
-
-
Save edrex/fb947c6fc6460c1629b4 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
| ::1 - [24/Feb/2016:12:13:53 -0800] "GET / HTTP/1.1" 200 550 | |
| ::1 - [24/Feb/2016:12:13:53 -0800] "GET /echo HTTP/1.1" 200 0 |
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
| localhost | |
| log access.log | |
| websocket /echo cat |
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 lang="en"> | |
| <head> | |
| <meta charset="UTF-8"/> | |
| </head> | |
| <body> | |
| <script> | |
| function testEchoSocket(path) { | |
| var s = new WebSocket('ws://'+location.hostname+':'+location.port + path); | |
| s.onmessage = function (event) { | |
| console.log(event.data); | |
| s.close(); | |
| } | |
| s.onopen = function (event) { | |
| s.send("ohai"); | |
| } | |
| } | |
| testEchoSocket('/echo'); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment