
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
req-real-ip
Advanced tools
This library allows you to get the real ip address of a user. It gives you the real ip address even if the request header is modified.
This library allows you to get the real ip address of a user. It gives you the real ip address even if the request header is modified.
import express from 'express';
import realip from 'req-real-ip';
const app = express();
app.listen(3000, () => {
console.log('Server is running');
});
app.use((req, res, next) => {
res.json({
user_ip: realip.detect({
req: req,
config: { cloudflare: false },
}),
});
});
cloudflare
If you are using Cloudflare, the ip address is sent in the cf-connecting-ip variable in the header. However, if Cloudflare is not used, the request can be manipulated by changing the header information. For this reason, if you are not using Cloudflare, you should send false.
FAQs
This library allows you to get the real ip address of a user. It gives you the real ip address even if the request header is modified.
We found that req-real-ip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.