We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using expressjs (nodejs) and tried to use this package to filter out IP addresses but getting below error:
Access denied to IP address: undefined
I have also tried proxy option too:
app.set('trust proxy', true);
My configurations:
const whitelistedIPs = [ "some-ip-address", // Replace with actual IP addresses "127.0.0.1", "::1", ]; const ipBlocker = ipfilter(whitelistedIPs, { mode: "allow", //logLevel: "deny" }); app.use((err, req, res, next) => { if (err instanceof IpDeniedError) { return res.status(403).send("Your IP is not allowed to access this resource."); } else { next(err); } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using expressjs (nodejs) and tried to use this package to filter out IP addresses but getting below error:
Access denied to IP address: undefined
I have also tried proxy option too:
app.set('trust proxy', true);
My configurations:
The text was updated successfully, but these errors were encountered: