summaryrefslogtreecommitdiffstats
path: root/net/data/websocket/connect_check.html
blob: 8d8e815b114c8822fbf517eef375ea1575733ce0 (plain)
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
<!DOCTYPE html>
<html>
<head>
<title>test ws connection</title>
<script type="text/javascript">
var protocol = location.protocol.replace('http', 'ws');
var url = protocol + '//' + location.host + '/echo-with-no-extension';
// Do connection test.
var ws = new WebSocket(url);

ws.onopen = function()
{
  // Set document title to 'PASS'. The test observer catches this title changes
  // to know the result.
  document.title = 'PASS';
}

ws.onclose = function()
{
  // Set document title to 'FAIL'.
  document.title = 'FAIL';
}

</script>
</head>
</html>