martinbrose / cloudflarepycli

Python CLI and python class for retrieving user's realtime performance statistics
GNU General Public License v3.0
19 stars 6 forks source link

Allow specifying use of IPv4 or IPv6, and other housekeeping #4

Closed VxJasonxV closed 5 months ago

VxJasonxV commented 2 years ago

Hey there, I'm using this package via a Docker container another user has built ( https://github.com/martinbrose/cloudflare-speedtest-exporter ) and I had a handful of thoughts.

Per your README;

There is also a request to ipdatabase.com and the return is screen-scraped for the actual ISP name.

This is not (no longer?) necessary as the Cloudflare stats expose this information in their data.

$ cfspeedtest --json
{"version": {"time": 1658013890.4583306, "value": 1.5}, "your_ip": {"time": 1658013890.5290189, "value": "24.9.13.37"}, …

Additionally, ipdatabase doesn't have AAAA records, so it will never report an IPv6 address even if you have one. For me, speed.cloudflare.com as well as cfspeedtest on my Mac does. I'm unsure why it only uses IPv4 in my Docker container, but there is a lot about Docker networking I don't know yet.

➤ cfspeedtest
version: 1.6
your ip: 2601:285:c133:7:dead::beef

I'm eager to be able to stagger v4 and v6 speed tests and collect those metrics uniquely.

martinbrose commented 5 months ago

Hi @VxJasonxV,

thanks for raising this issue and apologies it took so long to get a response. A lot has changed since then and the ipdatabase.com part is not around anymore.

You might have solved your IPv4 vs IPv6 issue? I suspect this is regarding the setup of the Docker network and has not much to do with this repo. See here: https://docs.docker.com/config/daemon/ipv6/

Anyways, please feel free to take the new version for a spin and let us know of any issues.