{"id":14990029,"url":"https://github.com/haibbo/speedtest-cli","last_synced_at":"2025-04-12T02:04:01.405Z","repository":{"id":54964123,"uuid":"132158655","full_name":"haibbo/speedtest-cli","owner":"haibbo","description":"Command line client for speedtest.net written in C","archived":false,"fork":false,"pushed_at":"2023-05-30T15:30:48.000Z","size":28,"stargazers_count":30,"open_issues_count":5,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T02:03:56.405Z","etag":null,"topics":["c","libcurl","libexpat","speedtest"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haibbo.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-04T15:37:50.000Z","updated_at":"2024-12-02T15:08:52.000Z","dependencies_parsed_at":"2024-09-15T17:22:23.609Z","dependency_job_id":null,"html_url":"https://github.com/haibbo/speedtest-cli","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.2142857142857143,"last_synced_commit":"6b459aa8594457970866fe772cbd0aa7be06d92a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haibbo%2Fspeedtest-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haibbo%2Fspeedtest-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haibbo%2Fspeedtest-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haibbo%2Fspeedtest-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haibbo","download_url":"https://codeload.github.com/haibbo/speedtest-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505863,"owners_count":21115354,"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":["c","libcurl","libexpat","speedtest"],"created_at":"2024-09-24T14:19:21.447Z","updated_at":"2025-04-12T02:04:01.384Z","avatar_url":"https://github.com/haibbo.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# speedtest-cli\n[C Version]Command line interface for testing internet bandwidth using speedtest.net\n\n## Introduce\nThis project depends libcurl-devl and libexpat-devl, and can work on MAC and Linux OS.\n\nThis project is a C version of [sivel/speedtest-cli](https://github.com/sivel/speedtest-cli), But they have some differences.\nI will expain more about my implement later.\n\n\n## Test\n### Run on my linux VPS:\n```shell\n[root@host speedtest-cli]# ./speedtest_cli\nRetrieving speedtest.net configuration...\nRetrieving speedtest.net server list...\nTesting from IT7 Networks (65.49.209.201)...\nSelecting best server based on ping...\nBestest server: speedtest.lax.gigenet.com(1.30KM)\nServer latency is 2ms\nTesting download speed...\nDownload speed: 732.04Mbps\nTesting upload speed.........................\nUpload speed: 721.83Mbps\n```\n### Run on my Mac OS:\n```shell\n~/t/s/speedtest-cli git:master ❯❯❯ ./speedtest_cli\nRetrieving speedtest.net configuration...\nRetrieving speedtest.net server list...\nTesting from China Telecom jiangsu (114.218.xx.xxx)...\nSelecting best server based on ping...\nBestest server: hgh.unpergroup.cn(86.86KM)\nServer latency is 120ms\nTesting download speed........................\nDownload speed: 27.34Mbps\nTesting upload speed.........\nUpload speed: 8.85Mbps\n```\n\n## Test Step\nSpeedtest.net operates entirely over HTTP for maximum compatibility. It tests ping (latency), download speed and upload speed.\n\n### Ping\n1. Get server list from speedtest.net\n2. Select 10 closest servers according to their longitude/latitude and your computer location\n3. Sends HTTP requests to the selected server, and measures the time it takes to get a response.\n\n### Download Speed\n1. Your computer downloads small binary files from the web server to the client, and we measure that download to estimate the connection speed.\n2. Based on this result, we choose how much data to download for the real test. Our goal is to pick the right amount of data that you can download in 10 seconds, ensuring we get enough for an accurate result but not take too long.\n3. Once we start downloading, we use up to four HTTP threads to saturate your connection and get an accurate measurement.\n4. Calculate speed 5 times per second, and save them into 50 slices\n5. The fastest 10% and slowest 20% of the slices are then discarded.\n6. The remaining slices are averaged together to determine the final result.\n\n### Upload Test\n\n1. A small amount of random data is generated in the client and sent to the web server to estimate the connection speed.\n2. Based on this result, and appropriately sized chunck of randomly generated data is selected for upload.\n3. The upload test is then performed in chunks of uniform size, pushed to the server-side script via POST.\n4. We'll use up to four HTTP threads here as well to saturate the connection.\n5. Chunks are sorted by speed, and The fastest 10% and slowest 20% of the slices are then discarded and determine the result.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaibbo%2Fspeedtest-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaibbo%2Fspeedtest-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaibbo%2Fspeedtest-cli/lists"}