aqua
aqua copied to clipboard
get user ip address
How to get user ip address
If your server is not running behind a proxy, you can now use the following code since Aqua v1.3.0
app.get("/", req => {
const remoteHostname = (req.conn?.remoteAddr as Deno.NetAddr)?.hostname;
// ...
});
It depends on your goal, but generally, I think getting a user IP address is not that helpful. Because it changes too often. It's better to generate a UUID for each machine using tools like FingerprintJS