gja / cloudflare-worker-local

Run a Cloudflare Worker Locally

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cf-* header support

jdanyow opened this issue · comments

Should we add support for cloudflare headers? Particularly CF-Connecting-IP.

https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers-

Oops, didn't notice this. Is the CF-Connecting-IP header available in the worker? I suspect that it's added by nginx behind it. I wonder if anyone else on the thread has an opinion.

It's available in the worker- important for logging scenarios like this: https://blog.cloudflare.com/dogfooding-edge-workers/

Ok, I think it makes sense. Please go ahead and add support, except for IP Country.

There is no way to do geoip without a network call afaik, and I don’t want to compromise privacy.

According to cloudflare, they use XX as the value for unknown country. But we can probably use “DEV” or something to signify its a test.

closed via #22 👍