1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/http-server/minimal-http-server-tls/mount-origin/index.html

40 lines
966 B
HTML
Raw Normal View History

2018-03-20 13:28:25 +08:00
<meta charset="UTF-8">
<html>
<body>
<img src="libwebsockets.org-logo.png"><br>
Hello from the <b>minimal https server example</b>.
<br>
You can confirm the 404 page handler by going to this
nonexistant <a href="notextant.html">page</a>.
<br>
<div id="transport"></div>
</body>
<script>
window.onload = function() {
var transport_protocol = "";
if ( performance && performance.timing.nextHopProtocol ) {
transport_protocol = performance.timing.nextHopProtocol;
} else if ( window.chrome && window.chrome.loadTimes ) {
transport_protocol = window.chrome.loadTimes().connectionInfo;
} else {
var p = performance.getEntriesByType("resource");
for (var i=0; i < p.length; i++) {
var value = "nextHopProtocol" in p[i];
if (value)
transport_protocol = p[i].nextHopProtocol;
}
}
if (transport_protocol == "h2")
document.getElementById("transport").innerHTML = "<img src=\"/http2.png\">";
}
</script>
</html>