mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-23 00:00:06 +01:00

Generic sessions has been overdue some love to align it with the progress in the rest of lws. 1) Strict Content Security Policy 2) http2 compatibility 3) fixes and additions for use in a separate process via unix domain socket 4) work on ws and http proxying in lws 5) add minimal example
22 lines
No EOL
697 B
JavaScript
22 lines
No EOL
697 B
JavaScript
document.addEventListener("DOMContentLoaded", 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\">";
|
|
}
|
|
}, false); |