Initial commit

This commit is contained in:
ChK
2026-02-01 13:20:37 +01:00
commit fc7d40ac64
20 changed files with 1627 additions and 0 deletions

40
3DInput.js Executable file
View File

@@ -0,0 +1,40 @@
const fs = require('fs');
const https = require('https');
const WebSocket = require('ws');
const url = require('url');
const httpsOptions = {
"enable": true,
'key': fs.readFileSync('https/localhost.key'),
'cert': fs.readFileSync('https/localhost.pem'),
"passphrase": "abcd"
}
server = https.createServer(httpsOptions, (req, res) => {
let parsedURL = url.parse(req.url, true);
let path = parsedURL.path.replace(/^\/+|\/+$/g,"");
if(path == ""){ path = "index.html"; }
let file = __dirname + "/public/" + path;
console.log("file : " + file);
fs.readFile(file, function(err, content){
if(err){
console.log("File Not found "+ file);
res.writeHead(404);
res.end();
} else {
res.setHeader('X-Content-Type-Option', 'nosniff');
//let mime = lookup(path);
let mime = "text/html"
res.writeHead(200,{'Content-type': mime});
res.end(content);
}
})
});
server.listen(10010);
console.log("Connect to: https://localhost:10010")