aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
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>