diff options
author | cbdev <cb@cbcdn.com> | 2019-05-19 11:03:45 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2019-05-19 11:03:45 +0200 |
commit | 92638847a3b7f51fb795c7986b793536ece6beee (patch) | |
tree | fe67899cf254c9e00f28a93cc12d4fb1928f2b32 /index.html | |
parent | 75d1e4955b220495f6d2655b18989db567faa5ce (diff) | |
download | websocksy-92638847a3b7f51fb795c7986b793536ece6beee.tar.gz websocksy-92638847a3b7f51fb795c7986b793536ece6beee.tar.bz2 websocksy-92638847a3b7f51fb795c7986b793536ece6beee.zip |
Documentation & peer discovery API
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2,10 +2,11 @@ <head> <script type="text/javascript"> var webSocket = null; + var payload = "foo"; function openSocket(){ setTimeout(function(){ - webSocket = new WebSocket("ws://localhost:8001/foo/bar"); + webSocket = new WebSocket("ws://localhost:8001/foo/bar", ["p1", "p2"]); webSocket.onclose = openSocket; webSocket.onmessage = function(event){ console.log(event.data); @@ -16,7 +17,8 @@ function init(){ openSocket(); setInterval(function(){ - webSocket.send("foo"); + webSocket.send(payload); + payload += payload; }, 1000); } </script> |