OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>test ws 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 scheme = href.indexOf('https') >= 0 ? 'wss' : 'ws'; | |
12 var url = scheme + '://localhost:' + port + '/websocket/tests/echo'; | |
13 | |
14 // Do connection test. | |
15 var ws = new WebSocket(url); | |
16 | |
17 ws.onopen = function() | |
18 { | |
19 // Set document title to 'PASS'. The test observer catches this title changes | |
20 // to know the result. | |
21 document.title = 'PASS'; | |
22 } | |
23 | |
24 ws.onclose = function() | |
25 { | |
26 // Set document title to 'FAIL'. | |
27 document.title = 'FAIL'; | |
28 } | |
29 | |
30 </script> | |
31 </head> | |
32 </html> | |
OLD | NEW |