app: try to get real client ip
This commit is contained in:
parent
3d57e5ca75
commit
77014458d0
1
index.js
1
index.js
|
|
@ -22,6 +22,7 @@ process.on('uncaughtException', (e) => {
|
|||
logger.info('🍻 RSSHub start! Cheers!');
|
||||
|
||||
const app = new Koa();
|
||||
app.proxy = true;
|
||||
|
||||
// favicon
|
||||
app.use(favicon(__dirname + '/favicon.png'));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const logger = require('../utils/logger');
|
||||
|
||||
module.exports = async (ctx, next) => {
|
||||
logger.info(`${ctx.url}, user IP: ${ctx.ip}`);
|
||||
logger.info(`${ctx.url}, user IP: ${ctx.ips[0] || ctx.ip}`);
|
||||
|
||||
const headers = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
|
|
|
|||
Loading…
Reference in New Issue