How to get Client IPv4

Hi team,

I have a Nodejs application in Flyio, I want to get Client IPv4, but when I use Fly-Client-IP it doesn’t provide IPv4 format, it is “2001:ee0:4141:…”

As usually, I often use req.headers[“x-forwarded-for”], but here it doesn’t have IPv4 either.

Is there any way to get Client IPv4?

My guess is that your client is connecting through IPv6.

You need to disable IPv6 on your server or force your client to use IPv4.

When I use the default domain XXX.fly.dev, it returns IPv6
But when I use a custom domain, it returns IPv4, so it’s not a big deal here.
Thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.