mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 06:27:10 +03:00
Initial refactor (routes and utils to respective folders)
This commit is contained in:
6
src/utils/getIP.js
Normal file
6
src/utils/getIP.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var fs = require('fs');
|
||||
var config = JSON.parse(fs.readFileSync('config.json'));
|
||||
|
||||
module.exports = function getIP(req) {
|
||||
return config.behindProxy ? req.headers['x-forwarded-for'] : req.connection.remoteAddress;
|
||||
}
|
||||
Reference in New Issue
Block a user