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)