httpd.js did not work because of the box for me. But that led me to the right path. Then I found this, and after a little change in the settings and updating the code, I got a super-simple server system.
function startListen(){
console.log("Initializing server");
var socketServer = navigator.mozTCPSocket.listen(8080);
socketServer.onconnect = function(conn){
console.log("connected", conn, conn.ondata);
conn.ondata = function(ev){
console.log("Got request: ", ev);
conn.send("Ok. Got client on port " + conn.port);
conn.close();
};
conn.onclose = function(ev){
console.log("Client left:", ev);
}
};
socketServer.onerror = function(ev){
console.log("Failed to start: ", ev);
};
}
startListen();
Permission required tcp-socket.
With this code, I was able to run this in a Firefox OS simulator, directed my browser to open http: // localhost: 8080 and get the response and logs in the console.
PS. . , . Firefox OS " ", , ( , ).