aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-05-18 13:12:46 +0200
committercbdev <cb@cbcdn.com>2019-05-18 13:12:46 +0200
commitff94e4518d417d88f2fabdfca7025e68ce21849b (patch)
tree22232e7187cf5e7e9b03be84691a2b4f12de0645 /index.html
parentd28b5eb2960e80d80e967a3f01ce70e1fa457808 (diff)
downloadwebsocksy-ff94e4518d417d88f2fabdfca7025e68ce21849b.tar.gz
websocksy-ff94e4518d417d88f2fabdfca7025e68ce21849b.tar.bz2
websocksy-ff94e4518d417d88f2fabdfca7025e68ce21849b.zip
Complete WS connection establishment
Diffstat (limited to 'index.html')
-rw-r--r--index.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/index.html b/index.html
index 233ee69..8a9ae9c 100644
--- a/index.html
+++ b/index.html
@@ -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>