apernet / OpenGFW

OpenGFW is a flexible, easy-to-use, open source implementation of GFW (Great Firewall of China) on Linux
https://gfw.dev/
Mozilla Public License 2.0
9.31k stars 703 forks source link

Add ASN function #142

Open scientificworld opened 1 month ago

scientificworld commented 1 month ago

asn(ip: string, asn: int) -> bool

Check if an IP address belongs to a specific ASN.

Maybe we can use data from GeoLite2 ASN Database?