{"id":13646817,"url":"https://github.com/jackpal/gateway","last_synced_at":"2026-02-14T08:34:54.776Z","repository":{"id":30618261,"uuid":"34173642","full_name":"jackpal/gateway","owner":"jackpal","description":"A golang library for discovering the address of a LAN gateway.","archived":false,"fork":false,"pushed_at":"2025-04-03T19:00:13.000Z","size":90,"stargazers_count":231,"open_issues_count":1,"forks_count":67,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-21T21:38:43.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackpal.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,"zenodo":null}},"created_at":"2015-04-18T16:38:39.000Z","updated_at":"2025-04-14T08:17:21.000Z","dependencies_parsed_at":"2023-11-11T05:35:19.767Z","dependency_job_id":"445f8f90-f1f2-45cb-9da8-67cfdc340605","html_url":"https://github.com/jackpal/gateway","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/jackpal/gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackpal%2Fgateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackpal%2Fgateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackpal%2Fgateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackpal%2Fgateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackpal","download_url":"https://codeload.github.com/jackpal/gateway/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackpal%2Fgateway/sbom","scorecard":{"id":500785,"data":{"date":"2025-08-11","repo":{"name":"github.com/jackpal/gateway","commit":"890214bcf52915aaf5489761a7bf02fe752ba45f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/22 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 1 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/go.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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"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/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/jackpal/gateway/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/jackpal/gateway/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned 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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" 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":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"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 12 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-19T21:47:43.355Z","repository_id":30618261,"created_at":"2025-08-19T21:47:43.355Z","updated_at":"2025-08-19T21:47:43.355Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29440530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: 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":[],"created_at":"2024-08-02T01:03:08.422Z","updated_at":"2026-02-14T08:34:54.749Z","avatar_url":"https://github.com/jackpal.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# gateway\n\nA simple library for discovering the IP address of the default gateway.\n\nExample:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/jackpal/gateway\"\n)\n\nfunc main() {\n    gateway, err := gateway.DiscoverGateway()\n    if err != nil {\n        fmt.Println(err)\n    } else {\n        fmt.Println(\"Gateway:\", gateway.String())\n   }\n}\n```\n\nProvides implementations for:\n\n+ Darwin (macOS)\n+ Dragonfly\n+ FreeBSD\n+ Linux\n+ NetBSD\n+ OpenBSD\n+ Solaris and illumos\n+ Windows\n\nOther platforms use an implementation that always returns an error.\n\nPull requests for other OSs happily considered!\n\n## Versions\n\n### v1.1.1\n\n+ Filter out On-link gateways. This is a Windows-specific feature. On-link gateways aren't currently connected to the Internet.\n\n### v1.1.0\n\n+ Add `func DiscoverGateways() ([]net.IP, error)`. This func returns an array of gateways that contains at least one gateway. Otherwise returns an error.\n+ Update to go version 1.24.2\n+ Update dependencies to latest versions. (There was an x/net security warning.)\n\n### v1.0.16\n\nUpdate x/net dependency. This was done to squelch a github security\nalert caused by depending upon an old version of x/net.\n\n### v1.0.15\n\nUpdate dependencies to latest versions. This was done to squelch a github security\nalert caused by depending upon an old version of x/net. This is the first time I've\nupdated module versions, the tests pass, so hopefully everything's good.\n\n### v1.0.14\n\n+ [Fix panic when interface not set in Solaris `netstat -rn` output.](https://github.com/jackpal/gateway/pull/42)\n\n### v1.0.13\n\n+ Add tools/check-cross-compile.sh to check that the code compiles for various OSs.\n+ Fix compilation errors exposed by tools/check-cross-compile.sh.\n\n### v1.0.12\n\n+ If there are multiple default gateways, Windows now returns the gateway with the lowest metric.\n+ Fix solaris build break. (In theory, IDK how to test this easily.)\n+ Upgrade to golang 1.21\n+ Upgrade golang.org/x/net version, makes dependabot happy. Probably was not any actual security\n  issue because gateway doesn't use any of the APIs of golang.org/x/net that had security issues.\n\n### v1.0.11\n\n+ Implement DiscoverInterface for BSD-like OSes.\n\n### v1.0.10\n\n+ Fix non-BSD-based builds.\n  \n\n### v1.0.9\n\n+ Add go.mod and go.sum files.\n+ Use \"golang.org/x/net/route\" to implement all BSD variants.\n  + As a side effect this adds support for Dragonfly and NetBSD. \n+ Add example to README.\n+ Remove broken continuous integration.\n\n### v1.0.8\n\n+ Add support for OpenBSD\n+ Linux parser now supports gateways with an IP address of 0.0.0.0\n+ Fall back to `netstat` on darwin systems if `route` fails.\n+ Simplify Linux /proc/net/route parsers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackpal%2Fgateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackpal%2Fgateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackpal%2Fgateway/lists"}