ui changes

This commit is contained in:
biglyderv 2025-04-02 22:55:51 -04:00
parent 747389c697
commit 16290ebdb7
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
5 changed files with 34 additions and 19 deletions

View file

@ -13,8 +13,9 @@ app.set('trust proxy', true)
app.use(express.static('static'));
app.post('/', async function (req, res) {
let id = 'web:' + createHash('sha256').update(req.ip).digest('hex');
id = id.slice(0,24);
let id = 'web:' + createHash('sha256').update(req.ip).digest('hex');
console.log(req.ip)
id = id.slice(0, 24);
if (!sessions[id]) {
try {
@ -34,7 +35,7 @@ app.post('/', async function (req, res) {
if (channels[id].headersSent) return;
try {
channels[id].send(str).header('access-allow-control-origin','*')
channels[id].send(str).header('access-allow-control-origin', '*')
} catch (err) { }
}
});
@ -43,15 +44,15 @@ app.post('/', async function (req, res) {
})
}
setTimeout(async function() {
setTimeout(async function () {
if (!sessions[id]) return;
if (channels[id].headersSent) return;
try {
channels[id].send('Input is possibly malformed.').header('access-allow-control-origin','*')
channels[id].send('Input is possibly malformed.').header('access-allow-control-origin', '*')
} catch (err) {
}
},1000);
}, 1000);
channels[id] = res;