/::edge Experimental

The /::edge suffix returns a JSON object about the request and the Cloudflare location that served it. It works on any URL of any host the platform serves.

Note: The diagnostics suffix is experimental and may change.

Syntax

plain
https://name.rt.ht/::edge
https://name.rt.ht/docs/::edge
https://name.rt.ht/x/::edge?y=1

The path contains /::edge anywhere: /::edge, /docs/::edge, /::edge/x, /::edgefoo and /x/::edge?y=1 all answer. Any method works. The suffix is not limited to deployments: it answers on any URL of any host the platform serves.

Note: The slash matters. /docs::edge contains no /::edge. It is read as an ::e… source shortcut and redirects to /docs?.

Response

StatusContent-TypeBodyCache-Control
200text/plain;charset=UTF-8A JSON object, pretty-printed with two-space indentation.None

The body is JSON although the content type is text/plain. Read it with response.json(). The response sends Access-Control-Allow-Origin: *. If building the answer fails, the platform renders a 500 page "Edge encountered an error.", or plain text.

rt

An object with url, hostname, user, time, edge, vendor and server. url is the full request URL. user is the verified email, and it is left out when the visitor is signed out. time is an ISO timestamp. edge is true, vendor is "Elefunc, Inc." and server is "RTEdge.net".

cf

The Cloudflare request properties of the visitor, such as colo, country, city, region, timezone, asn, asOrganization, httpProtocol, tlsVersion, tlsCipher, clientTcpRtt, clientQuicRtt and botManagement. The set can vary by request and network. It describes the visitor who makes the request, including an approximate location. The response contains no IP address.

hm

Metadata about a custom hostname, or null.

Access

Anyone can use it. The platform answers before any deployment code runs and before the access gates, even when the route has a worker. The latency tester offers the suffix as its System probe.

Examples

Show where a page is served from

html
<output id=where></output>
<script type=module>
  const { cf } = await fetch('/::edge').then(r => r.json())
  where.value = `${cf.city}, ${cf.country} via ${cf.colo}`
</script>

The code reads cf.colo, the code of the serving data center, together with the visitor's city and country. In the playground the request reaches the network and describes the output origin, not a deployment.

Specifications

Not part of any specification. /::edge is an RTEdge.net feature. The cf object follows the Cloudflare Workers runtime:

Specification
Cloudflare Workers: Request, with the cf properties

Availability

FeaturePlaygroundRTEdge.netNotes
/::edge ExperimentalPartialYesIn the playground output, the request reaches the network unless a playground worker answers it, and it describes the output origin. On a deployment, the platform always answers first.

See also