-- create a server
-- 30s time out for a inactive client
sv=net.createServer(net.TCP, 30)
-- server listen on 80,
-- if data received, print data to console,
-- then send "hello world" to remote.
sv:listen(80,function(c)
c:on("receive", function(c,result)
print(result)
end)
c:send('<!DOCTYPE html>\n')
c:send('<html xmlns="http://www.w3.org/1999/xhtml">\n')
c:send('<head>\n')
c:send('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n')
c:send('<title> HTML5 Slider </title>\n')
c:send('<script type="text/javascript">\n')
c:send('function showValue(num){\n')
c:send('var result = document.getElementById("result");\n')
c:send('result.innerHTML = num;\n')
c:send('}\n')
c:send('</script>\n')
c:send('</head>\n')
c:send('<body>\n')
c:send('<input type="range" id="sliderBar" min="0" max="100" step="10" value="0" onChange="showValue(this.value);"/>\n')
c:send('<div id="result" style="height:20px;width:30px;border:1px solid #999">\n') --this is where it shows the value on chrome
c:send('</div>\n')
c:send('</body>\n')
c:send('</html>\n')
end)