Get the user IP address
Is there no better way to get the user IP address than doing this ๐๐ฝ?
https://github.com/EdamAme-x/deno-deploy-hono-ip/blob/main/entry.ts
It works, but it's a bit convoluted.
FYI, I use the IP address to implement a rate limiter.
GitHub
deno-deploy-hono-ip/entry.ts at main ยท EdamAme-x/deno-deploy-hono-ip
Deno Deploy Hono IP. Contribute to EdamAme-x/deno-deploy-hono-ip development by creating an account on GitHub.
2 Replies
You should be able to use this as long as you use Deno serve https://hono.dev/docs/helpers/conninfo
ConnInfo Helper - Hono
Ultrafast web framework for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.
Ah yes! It works and it's much cleaner. Thank you ๐