forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (37 loc) · 858 Bytes
/
index.html
File metadata and controls
44 lines (37 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<script src="jquery.min.js"></script>
<script src="stomp.js"></script>
</head>
<body>
Messages:
<div id="messages"></div>
<script>
var connectNow;
$(function () {
connectNow = function() {
var client = Stomp.client("wss://localhost:4443/");
client.debug = function(str) {
$("#debug").append(str + "\n");
};
console.log("connecting...");
client.connect("system", "manager", function (frame) {
console.log("connected.");
client.subscribe("/queue/foo", function (msg) {
$("#messages").append("<p>" + msg.body + "</p>");
});
}, function () {
// connect failed
console.log("disconnecting...");
client.disconnect(function() {
console.log("disconnected.");
window.setTimeout(connectNow, 1000);
});
});
};
connectNow();
});
</script>
</body>
</html>