Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brucewind/gcorecdnipselector
š to choose the best GcoreāIPs for connection š¶ with lowest latency.(gcoreä¼éip)
https://github.com/brucewind/gcorecdnipselector
cdn cloudflare cloudfront gcore ip-selector latency
Last synced: about 1 month ago
JSON representation
š to choose the best GcoreāIPs for connection š¶ with lowest latency.(gcoreä¼éip)
- Host: GitHub
- URL: https://github.com/brucewind/gcorecdnipselector
- Owner: BruceWind
- License: apache-2.0
- Created: 2022-10-11T03:06:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T04:04:41.000Z (9 months ago)
- Last Synced: 2024-04-13T18:07:54.931Z (9 months ago)
- Topics: cdn, cloudflare, cloudfront, gcore, ip-selector, latency
- Language: JavaScript
- Homepage:
- Size: 224 KB
- Stars: 23
- Watchers: 0
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GcoreCDNIPSelector
[äøę](https://github.com/BruceWind/GcoreCDNIPSelector/blob/main/README_zh.md)ļ½[English](https://github.com/BruceWind/GcoreCDNIPSelector/blob/main/README.md)
Select the optimal IP from [Gcore-CDN](https://gcore.com/cdn/) for the lowest latency and most stable connectionsš¶.
> I use Github Actionsļ¼[![Scan and Push](https://github.com/BruceWind/GcoreCDNIPSelector/actions/workflows/daily-cron-action.yml/badge.svg)](https://github.com/BruceWind/GcoreCDNIPSelector/actions/workflows/daily-cron-action.yml)ļ¼to run the repo in LAN, which generates a [result.txt](/result.txt) in case of available results. If U R Chinese guys, I recommand you open the file to look results, instead of running the repo. If you found latancies are 0 in result.txt, you should not trust them.
### Overview
Gcore's CDN delivers a seamless experience globally. However, network connections from China sometimes experience packet loss and high latency. To address this, some users prefer to bind Gcore's domain to low-latency IP addresses. This script helps select the IP addresses with the lowest latency for such situations.### Usage Instructions
1. set up node environment.
In case people haven't set up node. I highly recommend [nvm](https://github.com/nvm-sh/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows.) to set up.2. run this JS file.
```
npm install
node .
```3. wait for a few minutes to receive result.txt, which contains the optimal IP addresses saved in this folder.
For choosing the best one of result, you may need [ē«éæping](https://ping.chinaz.com/) to make sure that the connection is almost stable on every China citis. Otherwise, you can use your HTTP service to test bandwidth.
## In addition
----------------------------------At present, I use https://api.gcorelabs.com/cdn/public-net-list to query IPs. In case it expired, this script will be invalid. If you find this script is invalid, please put up an issue or find new URL to replace it.
### Spacial for post-Soviet countries
click to expand
I know some countries, like China, have a strong internet censorship system called the Great Firewall (GFW). It's even stricter than China's version. You might have trouble downloading IP ranges during running this script. To fix this, I have a backup plan. I use Github actions to save IP ranges in this repository every week. You can turn off the code `fetchWithTimeout()`. If you don't do that, it will still work, but it might take more time to finish.
## Have you tried AWS'CDN Cloudfront?
I have written another IP-selector for Cloudfront: https://github.com/BruceWind/CloudFrontIPSelector, you can try it.