I finally ended the last feature of my system, but I noticed I am not able to get the user’s IP.
It’s essential that I get the user’s IP for my system.
The only thing I’m getting are IPv6 from fly proxies/company.
Fly.io relies on CacheFly to support running full stack apps close to users globally, so I guess I don’t have a choice not to use it. I haven’t changed any settings as far as I remember.
Any ideas on how solve this? I didn’t setup any CDNs. What other info I can provide that would be useful to discover the problem?
It seems that CacheFly is not passing forward the information on the client IP, from where the request originated. If I am right, the client IP should be passed along in the first position of “x-forwarded-for”, shouldn’t it?
Or, perhaps fly.io is indeed receiving this information but deleting and keeping only the CacheFly IP in x-forwarded-for.
I’m just “thinking out loud” here, I’m not an expert in this.
So, maybe it’s a misconfiguration.
I think it would be useful first to be able to reproduce. I haven’t been able to do so yet.
Can you try making the request from a Fly VM using curl or from another region? You can also check curl debug.fly.dev to see if the headers look similar to the results you get.
I’ve tried what you suggested and I ended up isolating the problem.
The request was being made inside a server function. In short, the client side was making the request to a function that gets the Fly-Client-IP, but this function was being executed in the server, not in the client’s device, so it’s obvious it would return the Fly.io machine’s IP.
Thank you very much for your help. It helped me think outside of the box.