diff --git a/index.js b/index.js index a1da3fe..a3244ff 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ app.set('trust proxy', true) app.use(express.static('static')); app.post('/', async function (req, res) { - let ip = req.headers.get('X-Real-IP') || req.ip; + let ip = req.headers['X-Real-IP'] || req.ip; let id = 'web:' + createHash('sha256').update(ip).digest('hex'); console.log(ip); id = id.slice(0, 24); diff --git a/static/index.html b/static/index.html index 0fe8b2b..0607a84 100644 --- a/static/index.html +++ b/static/index.html @@ -12,7 +12,7 @@
- +
diff --git a/static/index.js b/static/index.js index 86149ae..20984f7 100644 --- a/static/index.js +++ b/static/index.js @@ -31,4 +31,8 @@ async function main(e) { addMsg(msg) } -form.addEventListener('submit', main); \ No newline at end of file +form.addEventListener('submit', main); + +document.getElementById('.send').addEventListener('click',function() { + main({preventDefault: () => {}}) +}) \ No newline at end of file