diff --git a/index.js b/index.js index c8058b4..fa45e2b 100644 --- a/index.js +++ b/index.js @@ -1043,7 +1043,7 @@ const logCall = (caller, callee, srcIp) => { } const genCall = (req, res, apiKey, ani, number) => { - const srcIp = process.env.PROXY_HEADER ? req.headers[process.env.PROXY_HEADER] : req.remoteAddress; + const srcIp = process.env.PROXY_HEADER ? req.headers[process.env.PROXY_HEADER] : req.ip; pool.getConnection().then(conn => { //conn.query("SELECT * FROM routes WHERE apiKey = ? AND block_start <= ? AND block_start + block_length >= ?", [apiKey, ani, ani]).then((rows) => { conn.query("SELECT * FROM routes WHERE apiKey = ?", [apiKey]).then((rows) => { // We'll try this Nick, if it doesn't work we'll go back to the original