blob: 0df543195999d066fc4d2dd47240c53a36297650 (
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
27
|
<!DOCTYPE html>
<html>
<head>
<title>test to close hanging wss connection</title>
<script type="text/javascript">
var href = window.location.href;
var queryBegin = href.lastIndexOf('?') + 1;
var port = href.slice(queryBegin);
var url = 'wss://localhost:' + port;
// Do connection test.
var ws = new WebSocket(url);
ws.onopen = function() {
// Set document title to 'FAIL'. The test observer catches this title change
// to know the result.
document.title = 'FAIL';
}
ws.onclose = function() {
// Set document title to 'PASS'. The test observer catches this title change
// to know the result.
document.title = 'PASS';
}
</script>
</head>
</html>
|