-
Notifications
You must be signed in to change notification settings - Fork 2
/
testhub.html
40 lines (34 loc) · 1 KB
/
testhub.html
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
<!DOCTYPE html>
<html>
<head>
<title>uri hub test</title>
<script src="http://localhost:9000/static/Orbited.js"></script>
<script>
TCPSocket = Orbited.TCPSocket;
</script>
<script src="http://localhost:9000/static/protocols/stomp/stomp.js"></script>
</head>
<body>
<script>
// In production use your js toolkit's onload system, or event listeners
// onload = function() {
stomp = new STOMPClient();
stomp.onopen = function() {
};
stomp.onclose = function(c) { console.log('Lost Connection, Code: ' + c);};
stomp.onerror = function(error) {
console.log("Error: " + error);
};
stomp.onerrorframe = function(frame) {
console.log("Error: " + frame.body);
};
stomp.onconnectedframe = function() {
stomp.subscribe("/hub");
};
stomp.onmessageframe = function(frame) {
console.log(frame.body)
};
stomp.connect('localhost', 61613);
// }
</script>
</body></html>