Code Monkey home page Code Monkey logo

cloudflare-ip-ping's Introduction

cloudflare-ip-ping

Cloudflare provides a CDN service which can speed up the websites. While using the free plan, you could not choose the nodes of the CDN. However, The cloudflare partner project allows users to use cname to get their websites into the CDN, which means users can choose whichever nodes they like.

There are some situations that you only want to speed up your websites at your location. I will tell you how to use Python to choose the the ip that suits you best.

Principle

Cloudflare has a ip list of their CDN, which can be obtained at here. The method that i use is very simple:

  1. Ping the IPs and get the latency and loss.
  2. Choose the best IP.
  3. Use Cloudflare Partner Project to cname your domain to the chosen ip.

Usage

python pingip.py

You will get a log file in your current directory.

In pingip.py file. You could change:

  • the number of threads to fit the performance of your computer and your network capacity.
  • the THRESHOLD under which the ip and latency will be logged into the log file.

Windows Clients

If you are using windows 10 x64. You can directly use the package I packed, It can be found [here].(https://github.com/olixu/cloudflare-ip-ping/releases)

How to contribute this repo

You could open an issue and upload your log file, tell me whether this script works or not, please attach your location and your network supplier.

Recommend VPS

To Do

cloudflare-ip-ping's People

Contributors

hackeryunen avatar olixu avatar

Watchers

 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.