Closest region

I need to identify the closest region.
Would it be possible for you adjust he CORS policy of debug.fly.dev so I can hit it from my frontend? / Do you have a method that does not involve an app deployment?

Hi,

I can’t answer that one, but if not this app may be of help. It shows the time from every region to every region:

https://rtt.fly.dev/

You can also see the ping between your location and Fly in the bottom-right corner of:

https://livebeats.fly.dev/signin

2 Likes

Do you need to identify the closest region to you, only once, or for your app’s users, for each incoming request?

Can you detail what your frontend needs to do? We can likely find a way to do what you need without mucking with CORS policies.

  • Daniel
  1. My users can request VMs.
  2. When they do, I need to identify the closest region to start a machine.
  3. I would like to avoid deploying the allocation service in every region I want to support.

If I can hit debug.fly.dev from the FE I can read “Fly-Region” and start the machine there.

The allocation service will get a fly-region header in requests that you can use for this.

When you get the request, can you parse the headers? It doesn’t appear to be something we advertise, but if you look for Fly-Request-Id, you will see a hex string followed by a dash followed by a region. Just be aware that that region may be an edge server.

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