| <!DOCTYPE html> | |
| <title>Testing HSTS with WebSockets</title> | |
| <script> | |
| var ws_url = window.location.hash.substring(1); | |
| var ws = new WebSocket(ws_url); | |
| ws.onopen = function() | |
| { | |
| ws.close(1000); | |
| } | |
| ws.onclose = function(evt) | |
| { | |
| // The fact that the WebSocket connect closed successfully means it opened | |
| // successfully, which means that SSL was used. | |
| document.title = evt.wasClean ? 'PASS': 'FAIL'; | |
| } | |
| </script> |