ui changes
This commit is contained in:
parent
747389c697
commit
16290ebdb7
5 changed files with 34 additions and 19 deletions
15
index.js
15
index.js
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue