Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get IP and Location from the browser js
function getCloudflareJSON(data): Promise<{
fl: string
h: string
ip: string
ts: number
visit_scheme: string
uag: string
colo: string
http: string
loc: string
tls: string
sni: string
warp: string
gateway: string
}> {
return fetch("")
.then(res => res.text())
.then(data => {
const arr = data
.map(e => e.split("="))
return Object.fromEntries(arr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment