php icon indicating copy to clipboard operation
php copied to clipboard

Retrieving your public IPv6 address

Open Eddict opened this issue 1 year ago • 0 comments

I am trying to retrieve my public IPv6 address but the getDetails() function, with $ip_address paramater set to null, only returns the IPv4 address. i have tried changing the const API_URL of the IPinfo class to 'https://v6.ipinfo.io' but somehow that leads to an curl error 7 which i do not understand. because if i use curl directly it works.

curl ipinfo.io/?token=mytoken

returns json with ip as ipv4 address

curl ipinfo.io/ip/?token=mytoken

returns string ip as ipv4 address

curl v6.ipinfo.io/ip/?token=mytoken

returns string ip as ipv6 address

curl https://v6.ipinfo.io/ip/?token=mytoken

returns string ip as ipv6 address

any idea why the curl error?

Eddict avatar Mar 12 '23 21:03 Eddict