Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 557 Bytes

File metadata and controls

37 lines (26 loc) · 557 Bytes

ip-worker

A Cloudflare Worker that returns your IP address or IP country code.

IP

Returns the IP v4 or v6 address of the request.

GET / or GET /ip

$ curl https://ip.willow.sh/
127.0.0.1
$ curl https://ip.willow.sh/ \
    -H 'Accept: application/json'
{"ip":"82.30.43.178"}

Country Code

Returns the country code of the request as determined by Cloudflare.

GET /cc

$ curl https://ip.willow.sh/cc
GB
$ curl https://ip.willow.sh/cc \
    -H 'Accept: application/json'
{"cc":"GB"}