I'm writing a tiny web server running from an microcontroller.
I'm having issues serving pages on not standard ports (e.g. 8080, or whatever).
When the server is running normally at port 80, no problems at all but if I change it the page wont load, instead, firefox screen show the actual page's code but no rendering any elements just page´s code text.
I'm confused because:
1- Internet Explorer opens the page on same situation (page hosted on the tiny web server, alternate port)
2- Chrome also opens it (using the mobile version | didnt tested on desktop)
2- If I host the same page on Apache, on some alternate port on localhost, firefox opens it normally from e.g 'localhost:8080'
Page is hosted on the LAN (e.g. 192.168.1.1:8080), I've tried '192.168.1.1:8080' on address bar also 'http://192.168.1.1:8080' but no deal.
I fear this is probably not a Firefox related issue but it works on other browsers.
Maybe I'm missing specs Firefox is not relaxed for? Like, expecting a server's signature/description I'm not sending? Anyway.. Stuff do work if using the standard port 80 so I'm lost about it.
Any clue or direction to make this Firefox compatible is greatly appreciated.
Testing this on Firefox 47.0.1 - Windows 7 64bit
Thanks!
The example page code I'm using:
Code: Select all
<script>
function setcookie() {
var status = "none";
document.cookie = "SID=; expires=1970";
if(status=="checked") {
document.cookie = "SID=947";
window.location="initconf";
}
else if(status=="wrong") { alert("Senha incorreta");
window.location="/";
}
}
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-1">
<title>testing page</title>
</head>
<body onload="setcookie()"; style="background-color: #dbe7aa">
<div id="lgs" class="ma">
<div id="ls" class="co">
</div>
<div id="lc" align="center"><img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABdAFADASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAYHBQQDAf/EADcQAAEDAwEFBQYDCQAAAAA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Zn8QxjcFo69Vu9Z8cyRXuREXMgiIgIiIClNvQ59LQsaCXOldgAczgKrXzkp4ZZoppIw58OTGT8JPM/RZY18ddE9szsu23tbW1zA6qPFjDxEX/AF+ipURNaur2giIsQREQf//Z" width="80" height="120"
alt="logo" /><br><br><span style="color: #090"><strong><em>Page</em></strong></span>
</div>
<div id="lr" class="co">
</div>
<div id="bt" align="center"><span style="color: #090"><strong>Login:</strong></span>
</div>
<form action="logi" method="post" id="bts" enctype="application/x-www-form-urlencoded">
<div id="bt2" align="left" ><strong>Senha:</strong>
<input type="password" name="password" id="s1">
<input type="checkbox" id="ch" onclick="chk()">
<label for="checkbox">Mostrar </label>
<input type="hidden" name="h" value="ÿ" maxlength="1" >
</div>
<div id="bt3" align="center" >
<input type="button" name="button" id="button" value="Entrar" onclick="validsession();">
</div>
</form>
</div>
<script>
function chk() {
var a=document.getElementById("ch");
var b=document.getElementById("s1");
if(a.checked) b.type = "text"; else b.type = "password";
}
function validsession() {
document.getElementById("bts").submit();
}
</script>
<style>
#bt3{
float: left;
height: 30px;
width: 95%;
//border: 1px solid #879E2E;
padding-top: 15px;
padding-left: 15px;
}
#bt2{
float: left;
height: 50px;
width: 80%;
//border: 1px solid #879E2E;
padding-top: 27px;
padding-left: 45px;
}
#bt{
float: left;
height: 25px;
width: 99%;
//border: 1px solid #879E2E;
}
.ma {
font-family: Verdana, Geneva, sans-serif;
}
.co{
float: left;
width: 33%;
height: 190px;
//border: 1px solid #879E2E;
}
#lc {
//overflow:auto;
height: 175px;
width: 32%;
float: left;
padding-top: 15px;
//border: 1px solid #879E2E;
}
#lgs {
overflow: auto;
height: 370px;
width: 400px;
position: fixed;
border-radius: 5px;
top: 50%;
left: 50%;
border: 1px solid #879E2E;
transform: translate(-50%, -50%);
}
</style>
</body>
</html>