forked from anandkumarpatel/test-ws-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
32 lines (27 loc) · 911 Bytes
/
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
<!DOCTYPE html>
<html>
<body>
MASTER BRANCH
<p id="target"></p>
<p id="demo"></p>
<script src="http://test-ws-server-staging-runnable.runnablecloud.com:80/primus/primus.js"></script>
<script>
// connect to current URL
var primus = Primus.connect("http://test-ws-server-staging-runnable.runnable.ninja:80")
primus.on("open", function() {
console.log("Connected!")
})
primus.on("data", function(data) {
document.getElementById("demo").innerHTML += data + "<br>";
})
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange=function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("target").innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "http://test-ws-server-staging-runnable.runnablecloud.com:80/test/path", true);
xhttp.send();
</script>
</body>
</html>