diff options
| author | cbdev <cb@cbcdn.com> | 2019-05-18 13:12:46 +0200 |
|---|---|---|
| committer | cbdev <cb@cbcdn.com> | 2019-05-18 13:12:46 +0200 |
| commit | ff94e4518d417d88f2fabdfca7025e68ce21849b (patch) | |
| tree | 22232e7187cf5e7e9b03be84691a2b4f12de0645 /index.html | |
| parent | d28b5eb2960e80d80e967a3f01ce70e1fa457808 (diff) | |
| download | websocksy-ff94e4518d417d88f2fabdfca7025e68ce21849b.tar.gz websocksy-ff94e4518d417d88f2fabdfca7025e68ce21849b.tar.bz2 websocksy-ff94e4518d417d88f2fabdfca7025e68ce21849b.zip | |
Complete WS connection establishment
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,8 +1,16 @@ <html> <head> <script type="text/javascript"> + var webSocket = null; + + function openSocket(){ + webSocket = new WebSocket("ws://localhost:8001/foo/bar"); + webSocket.onclose = openSocket; + } + function init(){ - var webSocket = new WebSocket("ws://localhost:8001/foo/bar"); + openSocket(); + setInterval(function(){webSocket.send("foo");}, 1000); } </script> </head> |
