{"id":21880485,"url":"https://github.com/brucewind/cloudfrontipselector","last_synced_at":"2025-10-26T15:13:37.205Z","repository":{"id":65620466,"uuid":"532762573","full_name":"BruceWind/CloudFrontIPSelector","owner":"BruceWind","description":"🔍To choose the best CloudFront IPs for achieving fast and low-latency connections","archived":false,"fork":false,"pushed_at":"2023-11-12T07:02:49.000Z","size":3978,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2023-11-13T02:28:44.491Z","etag":null,"topics":["aws-cloudfront","cdn","china","cloudflare","cloudfront","ip-selector","latency","low-latency","network-optimization","speedtest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BruceWind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-09-05T05:56:08.000Z","updated_at":"2023-11-11T05:36:27.000Z","dependencies_parsed_at":"2023-11-12T02:28:38.939Z","dependency_job_id":"fab9d798-ab8a-4979-b0c1-7944809b6d75","html_url":"https://github.com/BruceWind/CloudFrontIPSelector","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FCloudFrontIPSelector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FCloudFrontIPSelector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FCloudFrontIPSelector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FCloudFrontIPSelector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BruceWind","download_url":"https://codeload.github.com/BruceWind/CloudFrontIPSelector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226888107,"owners_count":17698110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cloudfront","cdn","china","cloudflare","cloudfront","ip-selector","latency","low-latency","network-optimization","speedtest"],"created_at":"2024-11-28T09:14:08.172Z","updated_at":"2025-10-26T15:13:32.149Z","avatar_url":"https://github.com/BruceWind.png","language":"JavaScript","readme":"# CloudFrontIPSelector\n\n[中文](https://github.com/BruceWind/CloudFrontIPSelector/blob/main/README_zh.md)｜[English](https://github.com/BruceWind/CloudFrontIPSelector/blob/main/README.md)\n\nThis project helps choose the best CloudFront IPs for achieving fast and low-latency connections.\n\n\n### Background\nBecause AWS's DNS function is so good, users of AWS CloudFront typically report having an extremely steady experience.\n\nOn the other hand, those living in China use it often get timeout, shipments lost and high latency. As a result, some people prefer to bind to CloudFront's domain using low-latency IP addresses. I created this script to choose IPs with the lowest latency in these situations.\n\n\n### How to use?\n\n1. set up node environment\n\nIn case people who havn't set up node. I highly recommand [nvm](https://github.com/nvm-sh/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows.) to set up.\n\n2. connect to a stable network environment\n\nPlease note that when the WIFI connection is unstable, it may result in a longer latency between your computer and router. This can have a negative impact on the scan process and may affect the accuracy of the results.\n\nIt is recommended to connect an **ethernet** wire and your computer, otherwise you must make sure your WIFI connection is stable. Without a stable connection, this script may can not obtain any IPs that latency below  **threshold**.\nA tips to know if your WIFI connection is stable is to ping your gateway IP(e.g. 192.168.0.1 or 192.168.50.1 which depends your local-IP, whose last number changed to 1). Or move your laptop close to your router.\n\n3. run this JS file.\n```\nnpm install\nnode ./  \n# or you would like find IPs with nation short name like SG, you can run \"node ./ SG\"\n```\n\n4. wait\n\nwait minites to get `result.txt` which contain best IPs will be saved in this folder.\n\n\n### In addition\n\na. I limited latency of selected IPs must below 80, if you want to change it, you can modify  this variable `THREASHOLD` in `index.js`.\n\nb. Have you tried Gcore-CDN?   I have written another IP-selector for Gcore: https://github.com/BruceWind/GcoreCDNIPSelector, you can give it a shot.\n\n\nc. Why didn't I test **the up/down speed** in code? I've tested it by another method and found that all IPs of Cloudfront have very high speed. As a result, there is no evidence to suggest that different IPs have different speeds. In other words, I believe that you just need to make sure the CDN IP that you connect has low-latency.\n\n**Thanks**\n\n[sapics/ip-location-db](https://github.com/sapics/ip-location-db) provides geoip databse.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrucewind%2Fcloudfrontipselector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrucewind%2Fcloudfrontipselector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrucewind%2Fcloudfrontipselector/lists"}