{"id":13582098,"url":"https://github.com/showwin/speedtest-go","last_synced_at":"2026-01-14T13:32:29.965Z","repository":{"id":43196191,"uuid":"44506430","full_name":"showwin/speedtest-go","owner":"showwin","description":"CLI and Go API to Test Internet Speed using speedtest.net","archived":false,"fork":false,"pushed_at":"2025-10-15T19:46:14.000Z","size":7782,"stargazers_count":744,"open_issues_count":24,"forks_count":132,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-12-24T12:00:13.812Z","etag":null,"topics":["cli","go","network","speedtest"],"latest_commit_sha":null,"homepage":"","language":"Go","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/showwin.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":"2015-10-19T02:22:38.000Z","updated_at":"2025-12-23T04:23:42.000Z","dependencies_parsed_at":"2023-12-25T21:09:30.722Z","dependency_job_id":"e7465063-0264-4691-8641-8b856f7e202e","html_url":"https://github.com/showwin/speedtest-go","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/showwin/speedtest-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showwin%2Fspeedtest-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showwin%2Fspeedtest-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showwin%2Fspeedtest-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showwin%2Fspeedtest-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/showwin","download_url":"https://codeload.github.com/showwin/speedtest-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showwin%2Fspeedtest-go/sbom","scorecard":{"id":820947,"data":{"date":"2025-08-11","repo":{"name":"github.com/showwin/speedtest-go","commit":"d41df68f95a47de24848b90291211f6ae55c2f4a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/28 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/showwin/speedtest-go/release.yml/master?enable=pin","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:9"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.7.10 not signed: https://api.github.com/repos/showwin/speedtest-go/releases/191883044","Warn: release artifact v1.7.9 not signed: https://api.github.com/repos/showwin/speedtest-go/releases/173403319","Warn: release artifact v1.7.8 not signed: https://api.github.com/repos/showwin/speedtest-go/releases/165295940","Warn: release artifact v1.7.7 not signed: https://api.github.com/repos/showwin/speedtest-go/releases/156053021","Warn: release artifact v1.7.6 not signed: https://api.github.com/repos/showwin/speedtest-go/releases/155849901","Warn: release artifact v1.7.10 does not have provenance: https://api.github.com/repos/showwin/speedtest-go/releases/191883044","Warn: release artifact v1.7.9 does not have provenance: https://api.github.com/repos/showwin/speedtest-go/releases/173403319","Warn: release artifact v1.7.8 does not have provenance: https://api.github.com/repos/showwin/speedtest-go/releases/165295940","Warn: release artifact v1.7.7 does not have provenance: https://api.github.com/repos/showwin/speedtest-go/releases/156053021","Warn: release artifact v1.7.6 does not have provenance: https://api.github.com/repos/showwin/speedtest-go/releases/155849901"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T15:34:07.240Z","repository_id":43196191,"created_at":"2025-08-23T15:34:07.241Z","updated_at":"2025-08-23T15:34:07.241Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","go","network","speedtest"],"created_at":"2024-08-01T15:02:25.594Z","updated_at":"2026-01-14T13:32:29.956Z","avatar_url":"https://github.com/showwin.png","language":"Go","funding_links":[],"categories":["Go","CLI"],"sub_categories":[],"readme":"# speedtest-go\n**Full-featured Command Line Interface and pure [Go API](#go-api) to Test Internet Speed using [speedtest.net](http://www.speedtest.net/)**.\n\nYou can speedtest 2x faster than [speedtest.net](http://www.speedtest.net/) with almost the same result. [See the experimental results](https://github.com/showwin/speedtest-go#summary-of-experimental-results).\nInspired by [sivel/speedtest-cli](https://github.com/sivel/speedtest-cli)\n\n## CLI\n### Installation\n#### macOS (homebrew)\n\n```bash\n$ brew tap showwin/speedtest\n$ brew install speedtest\n\n### How to Update ###\n$ brew update\n$ brew upgrade speedtest\n```\n\n#### [Nix](https://nixos.org) (package manager)\n```bash\n# Enter the latest speedtest-go environment\n$ nix-shell -p speedtest-go\n```\n\n#### Other Platforms (Linux, Windows, etc.)\n\nPlease download the compatible package from [Releases](https://github.com/showwin/speedtest-go/releases).\nIf there are no compatible packages you want, please let me know on [Issue Tracker](https://github.com/showwin/speedtest-go/issues).\n\n#### Docker Build\n\nTo build a multi-architecture Docker image:\n\n```bash\n# Check if you already have a builder instance\ndocker buildx ls\n\n# Only create a new builder if you don't have one\n# If the above command shows no builders or none are in use, run:\ndocker buildx create --name mybuilder --use\n\n# Build and push for multiple platforms\ndocker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t yourusername/speedtest-go:latest --push .\n```\n\n#### Running the Container\n\n##### Docker\nRun the container with default settings (interactive shell):\n```bash\ndocker run -it yourusername/speedtest-go:latest\n```\n\nRun a speedtest with specific arguments:\n```bash\n# Run a basic speedtest\ndocker run yourusername/speedtest-go:latest speedtest-go\n\n# Run with specific server\ndocker run yourusername/speedtest-go:latest speedtest-go --server 6691\n\n# Run with multiple servers and JSON output\ndocker run yourusername/speedtest-go:latest speedtest-go --server 6691 --server 6087 --json\n\n# Run with custom location\ndocker run yourusername/speedtest-go:latest speedtest-go --location=60,-110\n```\n\n##### Kubernetes\nHere's an example Kubernetes pod specification that runs a speedtest:\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: speedtest\nspec:\n  containers:\n  - name: speedtest\n    image: yourusername/speedtest-go:latest\n    # Base command to run bash\n    command: [\"speedtest-go\"]\n    # Or run with specific arguments\n    # args: [\"--server\", \"6691\", \"--json\"]\n  restartPolicy: Never\n```\n\nFor a more complete deployment, you might want to use a CronJob to run periodic speedtests:\n\n```yaml\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n  name: speedtest\nspec:\n  schedule: \"0 */6 * * *\"  # Run every 6 hours\n  jobTemplate:\n    spec:\n      template:\n        spec:\n          containers:\n          - name: speedtest\n            image: yourusername/speedtest-go:latest\n            command: [\"speedtest-go\"]\n            args: [\"--json\"]\n          restartPolicy: OnFailure\n```\n\n### Usage\n\n```bash\n$ speedtest --help\nusage: speedtest-go [\u003cflags\u003e]\n\nFlags:\n      --help                   Show context-sensitive help (also try --help-long and --help-man).\n  -l, --list                   Show available speedtest.net servers.\n  -s, --server=SERVER ...      Select server id to speedtest.\n      --custom-url=CUSTOM-URL  Specify the url of the server instead of fetching from speedtest.net.\n      --saving-mode            Test with few resources, though low accuracy (especially \u003e 30Mbps).\n      --json                   Output results in json format.\n      --jsonl                  Output results in jsonl format (one json object per line).\n      --unix                   Output results in unix like format.\n      --location=LOCATION      Change the location with a precise coordinate (format: lat,lon).\n      --city=CITY              Change the location with a predefined city label.\n      --city-list              List all predefined city labels.\n      --proxy=PROXY            Set a proxy(http[s] or socks) for the speedtest.\n                               eg: --proxy=socks://10.20.0.101:7890\n                               eg: --proxy=http://10.20.0.101:7890\n      --source=SOURCE          Bind a source interface for the speedtest.\n      --dns-bind-source        DNS request binding source (experimental).\n                               eg: --source=10.20.0.101\n  -m  --multi                  Enable multi-server mode.\n  -t  --thread=THREAD          Set the number of concurrent connections.\n      --search=SEARCH          Fuzzy search servers by a keyword.\n      --ua                     Set the user-agent header for the speedtest.\n      --no-download            Disable download test.\n      --no-upload              Disable upload test.\n      --ping-mode              Select a method for Ping (support icmp/tcp/http).\n  -u  --unit                   Set human-readable and auto-scaled rate units for output \n                               (options: decimal-bits/decimal-bytes/binary-bits/binary-bytes).\n  -d  --debug                  Enable debug mode.\n      --version                Show application version.\n```\n\n#### Test Internet Speed\n\nSimply use `speedtest` command. The closest server is selected by default. Use the `-m` flag to enable multi-measurement mode (recommended)\n\n```bash\n## unix like format output\n# speedtest --unix\n$ speedtest\n\n    speedtest-go v1.7.10 @showwin\n\n✓ ISP: 124.27.199.165 (Fujitsu) [34.9769, 138.3831]\n✓ Found 20 Public Servers\n\n✓ Test Server: [6691] 9.03km Shizuoka (Japan) by sudosan\n✓ Latency: 4.452963ms Jitter: 41.271µs Min: 4.395179ms Max: 4.517576ms\n✓ Packet Loss Analyzer: Running in background (\u003c= 30 Secs)\n✓ Download: 115.52 Mbps (Used: 135.75MB) (Latency: 4ms Jitter: 0ms Min: 4ms Max: 4ms)\n✓ Upload: 4.02 Mbps (Used: 6.85MB) (Latency: 4ms Jitter: 1ms Min: 3ms Max: 8ms)\n✓ Packet Loss: 8.82% (Sent: 217/Dup: 0/Max: 237)\n```\n\n#### Test with Other Servers\n\nIf you want to select other servers to test, you can see the available server list.\n\n```bash\n$ speedtest --list\nTesting From IP: 124.27.199.165 (Fujitsu) [34.9769, 138.3831]\n[6691]     9.03km   32.3365ms  Shizuoka (Japan) by sudosan\n[6087]   120.55km   51.7453ms  Fussa-shi (Japan) by Allied Telesis Capital Corporation\n[6508]   125.44km   54.6683ms  Yokohama (Japan) by at2wn\n[6424]   148.23km   61.4724ms  Tokyo (Japan) by Cordeos Corp.\n...\n```\n\nand select them by id.\n\n```bash\n$ speedtest --server 6691 --server 6087\n\n    speedtest-go v1.7.10 @showwin\n\n✓ ISP: 124.27.199.165 (Fujitsu) [34.9769, 138.3831]\n✓ Found 2 Specified Public Server(s)\n\n✓ Test Server: [6691] 9.03km Shizuoka (Japan) by sudosan\n✓ Latency: 21.424ms Jitter: 1.644ms Min: 19.142ms Max: 23.926ms\n✓ Packet Loss Analyzer: Running in background (\u003c= 30 Sec)\n✓ Download: 65.82Mbps (Used: 75.48MB) (Latency: 22ms Jitter: 2ms Min: 17ms Max: 24ms)\n✓ Upload: 27.00Mbps (Used: 36.33MB) (Latency: 23ms Jitter: 2ms Min: 18ms Max: 25ms)\n✓ Packet Loss: 0.00% (Sent: 321/Dup: 0/Max: 320)\n\n✓ Test Server: [6087] 120.55km Fussa-shi (Japan) by Allied Telesis Capital Corporation\n✓ Latency: 38.694699ms Jitter: 2.724ms Min: 36.443ms Max: 39.953ms\n✓ Packet Loss Analyzer: Running in background (\u003c= 30 Sec)\n✓ Download: 72.24Mbps (Used: 83.72MB) (Latency: 37ms Jitter: 3ms Min: 36ms Max: 40ms)\n✓ Upload: 29.56Mbps (Used: 47.64MB) (Latency: 38ms Jitter: 3ms Min: 37ms Max: 41ms)\n✓ Packet Loss: 0.00% (Sent: 343/Dup: 0/Max: 342)\n```\n\n#### Test with a virtual location\n\nWith `--city` or `--location` option, the closest servers of the location will be picked.\nYou can measure the speed between your location and the target location.\n\n```bash\n$ speedtest --city-list\nAvailable city labels (case insensitive):\n CC             CityLabel       Location\n(za)                capetown    [-33.9391993, 18.4316716]\n(pl)                  warsaw    [52.2396659, 21.0129345]\n(sg)                  yishun    [1.4230218, 103.8404728]\n...\n\n$ speedtest --city=capetown\n$ speedtest --location=60,-110\n```\n\n#### Memory Saving Mode\n\nWith `--saving-mode` option, it can be executed even in an insufficient memory environment like IoT devices.\nThe memory usage can be reduced to 1/10, about 10MB of memory is used.\n\nHowever, please be careful that the accuracy is particularly low, especially in an environment of 30 Mbps or higher.\nTo get more accurate results, run multiple times and average.\n\nFor more details, please see [saving mode experimental result](https://github.com/showwin/speedtest-go/blob/master/docs/saving_mode_experimental_result.md).\n\n⚠️This feature has been deprecated \u003e v1.4.0, because speedtest-go can always run with less than 10MBytes of memory now. Even so, `--saving-mode` is still a good way to reduce computation.\n\n## Go API\n\n```bash\ngo get github.com/showwin/speedtest-go\n```\n\n### API Usage\n\nThe [code](https://github.com/showwin/speedtest-go/blob/master/example/naive/main.go) below finds the closest available speedtest server and tests the latency, download, and upload speeds.\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/showwin/speedtest-go/speedtest\"\n)\n\nfunc main() {\n\tvar speedtestClient = speedtest.New()\n\t\n\t// Use a proxy for the speedtest. eg: socks://127.0.0.1:7890\n\t// speedtest.WithUserConfig(\u0026speedtest.UserConfig{Proxy: \"socks://127.0.0.1:7890\"})(speedtestClient)\n\t\n\t// Select a network card as the data interface.\n\t// speedtest.WithUserConfig(\u0026speedtest.UserConfig{Source: \"192.168.1.101\"})(speedtestClient)\n\t\n\t// Get user's network information\n\t// user, _ := speedtestClient.FetchUserInfo()\n\t\n\t// Get a list of servers near a specified location\n\t// user.SetLocationByCity(\"Tokyo\")\n\t// user.SetLocation(\"Osaka\", 34.6952, 135.5006)\n    \n\t// Search server using serverID.\n\t// eg: fetch server with ID 28910.\n\t// speedtest.ErrServerNotFound will be returned if the server cannot be found.\n\t// server, err := speedtest.FetchServerByID(\"28910\")\n\t\n\tserverList, _ := speedtestClient.FetchServers()\n\ttargets, _ := serverList.FindServer([]int{})\n\n\tfor _, s := range targets {\n\t\t// Please make sure your host can access this test server,\n\t\t// otherwise you will get an error.\n\t\t// It is recommended to replace a server at this time\n\t\ts.PingTest(nil)\n\t\ts.DownloadTest()\n\t\ts.UploadTest()\n\t\t// Note: The unit of s.DLSpeed, s.ULSpeed is bytes per second, this is a float64.\n\t\tfmt.Printf(\"Latency: %s, Download: %s, Upload: %s\\n\", s.Latency, s.DLSpeed, s.ULSpeed)\n\t\ts.Context.Reset() // reset counter\n\t}\n}\n```\n\nThe [code](https://github.com/showwin/speedtest-go/blob/master/example/packet_loss/main.go) will find the closest available speedtest server and analyze packet loss.\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/showwin/speedtest-go/speedtest\"\n\t\"github.com/showwin/speedtest-go/speedtest/transport\"\n\t\"log\"\n)\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\n// Note: The current packet loss analyzer does not support udp over http.\n// This means we cannot get packet loss through a proxy.\nfunc main() {\n\t// Retrieve available servers\n\tvar speedtestClient = speedtest.New()\n\tserverList, _ := speedtestClient.FetchServers()\n\ttargets, _ := serverList.FindServer([]int{})\n\n\t// Create a packet loss analyzer, use default options\n\tanalyzer := speedtest.NewPacketLossAnalyzer(nil)\n\n\t// Perform packet loss analysis on all available servers\n\tfor _, server := range targets {\n\t\terr := analyzer.Run(server.Host, func(packetLoss *transport.PLoss) {\n\t\t\tfmt.Println(packetLoss, server.Host, server.Name)\n\t\t\t// fmt.Println(packetLoss.Loss())\n\t\t})\n\t\tcheckError(err)\n\t}\n\t\n\t// or test all at the same time.\n\tpacketLoss, err := analyzer.RunMulti(targets.Hosts())\n\tcheckError(err)\n\tfmt.Println(packetLoss)\n}\n```\n\n## Summary of Experimental Results\n\nSpeedtest-go is a great tool because of the following five reasons:\n* Cross-platform available.\n* Low memory environment.\n* We are the first **FULL-FEATURED** open source speed testing project based on speedtest.net, including down/up rates, jitter and packet loss, etc.\n* Testing time is the **SHORTEST** compare to [speedtest.net](http://www.speedtest.net/) and [sivel/speedtest-cli](https://github.com/sivel/speedtest-cli), especially about 2x faster than [speedtest.net](http://www.speedtest.net/).\n* Result is **MORE CLOSE** to [speedtest.net](http://www.speedtest.net/) than [speedtest-cli](https://github.com/sivel/speedtest-cli).\n\nThe following data is summarized. If you got interested, please see [more details](https://github.com/showwin/speedtest-go/blob/master/docs/experimental_result.md).\n\n### Download (Mbps)\n\ndistance = distance to testing server\n* 0 - 1000(km) ≒ domestic\n* 1000 - 8000(km) ≒ same region\n* 8000 - 20000(km) ≒ really far!\n* 20000km is half of the circumference of our planet.\n\n| distance (km) | speedtest.net | speedtest-go | speedtest-cli |\n|:-------------:|:-------------:|:------------:|:-------------:|\n|   0 - 1000    |     92.12     |  **91.21**   |     70.27     |\n|  1000 - 8000  |     66.45     |  **65.51**   |     56.56     |\n| 8000 - 20000  |     11.84     |     9.43     |   **11.87**   |\n\n### Upload (Mbps)\n\n| distance (km) | speedtest.net | speedtest-go | speedtest-cli |\n|:-------------:|:-------------:|:------------:|:-------------:|\n|   0 - 1000    |     65.56     |  **47.58**   |     36.16     |\n|  1000 - 8000  |     58.02     |  **54.74**   |     26.78     |\n| 8000 - 20000  |     5.20      |   **8.32**   |     2.58      |\n\n### Testing Time (sec)\n\n| distance (km) | speedtest.net | speedtest-go | speedtest-cli |\n|:-------------:|:-------------:|:------------:|:-------------:|\n|   0 - 1000    |     45.03     |  **22.84**   |     24.46     |\n|  1000 - 8000  |     44.89     |  **24.45**   |     28.52     |\n| 8000 - 20000  |     49.64     |  **34.08**   |     41.26     |\n\n## Contributors\n\nSee [Contributors](https://github.com/showwin/speedtest-go/graphs/contributors), PRs are welcome!\n\n## Issues\n\nYou can find or report issues in the [Issue Tracker](https://github.com/showwin/speedtest-go/issues).\n\n## LICENSE\n\n[MIT](https://github.com/showwin/speedtest-go/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowwin%2Fspeedtest-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshowwin%2Fspeedtest-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowwin%2Fspeedtest-go/lists"}