A simple way to get clients IP (Via Express)

app.set("trust proxy", function(ip) {
  return (/(10\.10\.([0-9]{1,3})\.([0-9]{1,3})|::ffff:127.0.0.1)/.test(ip));
});

This code will only work on glitch because of glitch’s reverse proxies ip’s but now you can use req.ip and be sure that its the real ip!

(THIS IS NOT FOOLPROOF) (feel free to put suggestions in the comments)

10 Likes

a lot of people can ddos now probably

just remember ddos is illegal

*hey look the memz Trojan is now open source!!!