Giter Site home page Giter Site logo

csyezheng / ip-scanner Goto Github PK

View Code? Open in Web Editor NEW
85.0 13.0 18.0 62 KB

This script is used to find the fastest IP for a given site such as Google Translate, Cloudflare, GitHub, etc.

License: MIT License

Go 100.00%
connectivity internet-access ip-scanner ping reachability scanner

ip-scanner's Introduction

ip-scanner

This script is used to find the fastest IP for a given domain name.

Use

  • GoogleTranslate

    Google has ended its Google Translate service in mainland China. In order to continue using Google's translation service, look for available IPs.

  • Cloudflare

    To better use Cloudflare pages and Cloudflare workers, find the fastest IP.

Quick start

Google Translate

Find available IPs for Google Translate:

go run cmd/google_translate/main.go
go run cmd/google_translate/main.go -config ./configs/config.toml

Fetch the latest IP ranges of Google Translate, save to the IPRangesFile path in the configuration file:

go run cmd/fetch_ip_ranges/main.go -site GoogleTranslate

Cloudflare

Find the fastest IP for Cloudflare:

go run cmd/cloudflare/main.go
go run cmd/cloudflare/main.go -config ./configs/config.toml

Fetch the latest IP ranges of Cloudflare, save to the IPRangesFile path in the configuration file:

go run cmd/fetch_ip_ranges/main.go -site Cloudflare

Custom site

Find available IPs for other websites, add configuration and run:

go run cmd/ip_scanner/main.go -site <site name>

Options:

-config string
    Config file, toml format (default "./configs/config.toml")
-site string
    site: the site name configured in the configuration file

Configuration

[General]
# GoogleTranslate or Cloudflare
Site = "GoogleTranslate"
# A boolean that turns on/off debug mode. true or false
Debug = false
# workers
Workers = 300
# Limit the maximum number of IPs scanned. No limit if it is less than or equal to 0.
ScannedLimit = 0
# Limit the maximum number of IPs found. No limit if it is less than or equal to 0.
FoundLimit = 10

[Ping]
# avaivable values: icmp, tcp, udp
Protocol = "icmp"
# Port for tcp and udp, icmp will ignore port
Port = 443
# Times of tests per IP
Count = 3
# Millisecond
Timeout = 500
# true: it's legal if it succeeds every time. false: it's legal if it has one succeeds
all = false

[HTTP]
# Standard HTTPS ports are 443 and 8443.
Port = 443
# Times of tests per IP
Count = 3
# Millisecond
Timeout = 2000
# true: it's legal if it succeeds every time. false: it's legal if it has one succeeds
all = false

[[Sites]]
Name = "GoogleTranslate"
# The API to fetch the IP ranges
IPRangesAPI = "https://www.gstatic.com/ipranges/goog.json"
# All IP ranges of google
IPRangesFile = "./data/all_google_translate_ip_ranges.txt"
# Customized IP ranges. If the file does not exist, will use IPRangesFile
CustomIPRangesFile = "./data/custom_google_translate_ip_ranges.txt"
# Output the available IPs found
IPOutputFile = "./data/output_google_translate_ips.txt"
# # boolean that turns on/off scanning for IPv6. true or false.
WithIPv6 = false
# URL for testing HTTPS connection
HttpsURL = "https://translate.google.com"
# Domains for write into hosts file
Domains = ["translate.google.com", "translate.googleapis.com"]

[[Sites]]
Name = "Cloudflare"
# The API to fetch the IP ranges
IPRangesAPI = "https://api.cloudflare.com/client/v4/ips"
# All IP ranges of cloudflare
IPRangesFile = "./data/all_cloudflare_ip_ranges.txt"
# Customized IP ranges. If the file does not exist, will use IPRangesFile
CustomIPRangesFile = "./data/custom_cloudflare_ip_ranges.txt"
# Output the available IPs found
IPOutputFile = "./data/output_cloudflare_ips.txt"
# A boolean that turns on/off scanning for IPv6. true or false.
WithIPv6 = false
# URL for testing HTTPS connection
HttpsURL = "https://yezheng.pages.dev"
# Domains for write into hosts file
Domains = ["yezheng.pages.dev"]

IP address ranges

ip-scanner's People

Contributors

csyezheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.