Skip to content

Instantly share code, notes, and snippets.

@jdecaron
Created September 15, 2022 20:09
Show Gist options
  • Save jdecaron/d3b3e3683c81f28e77edd5404c73b3d5 to your computer and use it in GitHub Desktop.
Save jdecaron/d3b3e3683c81f28e77edd5404c73b3d5 to your computer and use it in GitHub Desktop.
Cloudflare Worker that returns the IP address
addEventListener('fetch', event => {
return event.respondWith(
new Response(event.request.headers.get('CF-Connecting-IP'))
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment