-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (32 loc) · 1.09 KB
/
index.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
<!DOCTYPE html>
<html>
<body>
<h1>Open JavaScript console to watch log output (hit F12)</h1>
<script>AUTOBAHN_DEBUG = false;</script>
<script src="http://autobahn.s3.amazonaws.com/autobahnjs/latest/autobahn.min.jgz"></script>
<script>
var url;
if (document.location.origin == "file://") {
url = "ws://127.0.0.1:8080/ws";
} else {
url = (document.location.protocol === "http:" ? "ws:" : "wss:") + "//" +
document.location.host + "/ws";
}
var connection = new autobahn.Connection({
url: url,
realm: "realm1"
});
var connection = new autobahn.Connection({
url: "ws://localhost:8080/ws",
realm: "realm1"
});
connection.onopen = function (session, details) {
console.log("Connected:", details);
};
connection.onclose = function (reason, details) {
console.log("Connection lost: " + reason);
}
connection.open();
</script>
</body>
</html>