// index.jsvar ip_default = { async fetch(request) { return new Response(request.headers.get("x-real-ip")); }};export { ip_default as default};//# sourceMappingURL=index.js.map
// index.jsvar ip_default = { async fetch(request) { return new Response(request.headers.get("x-real-ip")); }};export { ip_default as default};//# sourceMappingURL=index.js.map
i've tried my worker with both
x-real-ip
x-real-ip
and
CF-Connecting-IP
CF-Connecting-IP
but both are returning ipv6 addresses.
i am building a dynamic dns solution so my worker was going to be pinged by my raspberrypi every 5 or so minutes and update the dns entry. i can obviously add an AAAA record with this, but I would like to grab the ipv4 address so i can use it for firewall rules. : )