String html_1 = R"=====(
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0'/>
<meta charset='utf-8'>
<title>Hello world</title>
<style>
html{font-family: arial,sans-serif; font-size:100%}
.big {font-size: 150%;}
</style>
</head>
<body>
<p><span id="rdm" class="big"></span></p>
<p>Load count:<span id="ld"></span></p>
<p>Timeout:<span id="tm"></span></p>
<p>Error:<span id="err"></span></p>
<p>Exception:<span id="exp1"></span></p>
</body>
<script>
var host;
var err = 0;
var tm = 0;
var exp1 =0;
var ld=0;
function processReceivedCommand(data)
{
var value= parseInt(data);
document.getElementById('rdm').innerHTML = value;
}
function restart()
{
setTimeout(loadData, 250);
}
function loadData()
{
const xhr = new XMLHttpRequest();
xhr.timeout=2000;
xhr.open('GET', '/range',true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-url');
xhr.addEventListener('error', () => {
err++;
document.getElementById('err').innerHTML = err;
restart();
});
xhr.addEventListener('load', () => {
ld++;
document.getElementById('ld').innerHTML = ld;
processReceivedCommand(xhr.responseText);
restart();
});
xhr.addEventListener('timeout', () => {
tm++;
document.getElementById('tm').innerHTML = tm;
restart();
});
try{
xhr.send();
}catch{
exp1++;
document.getElementById('exp1').innerHTML = exp1;
restart();
}
}
window.onload = function(e){
host = window.location.hostname;
loadData();
}
</script>
</html>
)=====";