I am working on a personal project and I was wondering why not use a kind of ip logger that logs the ip of a visitor and sends it to a Discord webhook. The code works, but only locally. I tried hosting the code on Glitch but i was getting this error in the console: grab.js: index.html: Answer This answer
Tag: ip
Extract ip and uag from Cloudflare cdn-cgi/trace text result using regex in JS
Hi I am planning to use Cloudflare cdn-cgi trace service to get clients IP and User Agent results. If I fetch this link: https://www.cloudflare.com/cdn-cgi/trace, the result I am getting is in a text format. Result text example: I did some research and figured out I need to use Regex? But not sure how to extr…
What’s the most performant way to do simple IP address comparisons?
I’m working in node.js, and I want to do something like the following pseudocode… Any ideas on the fastest way to do this? I’ve already checked out cidr-js, and it provides functionality for CIDR conversions but not IP address comparisons. Seems like node-ip could be a good choice. Thanks! A…
Redirect ranges of IPs in JavaScript (no .htaccess)
I’m trying to redirect anyone viewing my blog from certain IP addresses (or ranges of IP addresses) to a different page. I found something that works for individual IP addresses, but I can’t figure out how to block ranges of IP addresses – like 123.123.123.* Here’s the script: I’…