<!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() | |
{ | |
// The fact that the WebSocket connect opened successfully means that SSL was | |
// used. | |
document.title = 'PASS'; | |
} | |
ws.onclose = function(evt) | |
{ | |
if (!evt.wasClean) | |
document.title = 'FAIL'; | |
} | |
</script> |