Fetch the COLO within a Worker

I’m trying to make a Worker that returns similar information to what is displayed on https://www.cloudflare.com/cdn-cgi/trace because John Graham-Cumming just said on HN that the output of /cdn-cgi/trace can change, and should only be used for debugging purposes

However, is it possible to fetch the current COLO the Worker is being executed on within a worker? Similarly, is it also possible to fetch the http version?

If so, how?

Hello, yes it’s possible to fetch the colo within the CF worker.

See the request.cf object

It contains tlsVersion, tlsCipher, colo, country, asn, etc.

Keep in mind that these won’t be present in the quick-edit debug tool

1 Like