OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>test wss connection</title> | |
5 <script type="text/javascript"> | |
6 | |
7 var href = window.location.href; | |
8 var portBegin = href.lastIndexOf(':') + 1; | |
9 var portEnd = href.lastIndexOf('/'); | |
10 var port = href.slice(portBegin, portEnd); | |
11 var url = 'wss://localhost:' + port + '/websocket/tests/echo'; | |
12 | |
13 // Do connection test. | |
14 var ws = new WebSocket(url); | |
15 | |
16 ws.onopen = function() | |
17 { | |
18 // Set document title to 'PASS'. The test observer catches this title changes | |
19 // to know the result. | |
20 document.title = 'PASS'; | |
21 } | |
22 | |
23 ws.onclose = function() | |
24 { | |
25 // Set document title to 'FAIL'. | |
26 document.title = 'FAIL'; | |
27 } | |
28 | |
29 function timeOutCallback() | |
30 { | |
31 // Set document title to 'FAIL'. | |
32 document.title = 'FAIL'; | |
33 } | |
34 | |
35 setTimeout(timeOutCallback, 3000); | |
36 | |
37 </script> | |
38 </head> | |
39 </html> | |
OLD | NEW |