minor
This commit is contained in:
parent
7d559f9a31
commit
1e3fb44ea6
@ -9,7 +9,11 @@ module.exports = async (req, res, next) => {
|
||||
const ip = source_ip.split('.').reverse().join('.')
|
||||
const server_ip = '51.68.126.235'.split('.').reverse().join('.')
|
||||
const domain = `${ip}.80.${server_ip}.ip-port.exitlist.torproject.org`
|
||||
try {
|
||||
const ret = await lookup(domain, {})
|
||||
req.fromTor = (ret.address === '127.0.0.2')
|
||||
} catch(e) {
|
||||
req.fromTor = false
|
||||
}
|
||||
next()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user