Skip to content

Commit

Permalink
chore(patch): identificar IP real
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloGoncalvesBH committed Feb 1, 2024
1 parent 67e2ed3 commit 7d9890c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ if (!aplicacaoExecutandoLocalmente()) {

/* istanbul ignore if */
if (process.env.BLOCKED_IPS) {
app.use(ipfilter(process.env.BLOCKED_IPS.split(','), {
mode: 'deny'
app.use((req, res) => {
console.log('req.ip:', req.ip)
console.log('req.socket.remoteAddress:', req.socket.remoteAddress)
ipfilter(process.env.BLOCKED_IPS.split(','), {
mode: 'deny'
// log: false
}))
})
})
}

app.set('json spaces', 4)
Expand Down

0 comments on commit 7d9890c

Please sign in to comment.