swanchain / go-computing-provider

A golang implementation of computing provider
MIT License
11 stars 15 forks source link

update getLocalIPAddress #52

Closed dr4mohamed closed 2 months ago

dr4mohamed commented 2 months ago

https://ipapi.co/ip start using Verifying you are human. This may take a few seconds. logs : time="2024-04-28 09:32:23.572" level=info msg="publicIpAddress: <!DOCTYPE html><html lang=\"en-US\"><head><title>Just a moment...</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\"><meta name=\"robots\" content=\"noi use https://ifconfig.me/ with User-Agent: curl/7.61.1

Normalnoise commented 2 months ago

we need regional information, not just public IP

Normalnoise commented 2 months ago

I have tested https://ipapi.co/ip, it works

dr4mohamed commented 2 months ago

use in same region only not all regions, work in my vps , and not working with my home network

Normalnoise commented 2 months ago

curl ipinfo.io

it seems this more friendly

Normalnoise commented 2 months ago

https://github.com/swanchain/go-computing-provider/pull/54

dr4mohamed commented 2 months ago

use : http://ip-api.com/json/ without ip to get the ip and metadata in the same request

Normalnoise commented 2 months ago

thanks for your feedback, we will improve it