{"id":42121769,"url":"https://github.com/netinternet/remoteaddr","last_synced_at":"2026-01-26T14:33:52.421Z","repository":{"id":51322567,"uuid":"367402399","full_name":"netinternet/remoteaddr","owner":"netinternet","description":"Go http real ip header parser","archived":false,"fork":false,"pushed_at":"2021-12-08T12:50:16.000Z","size":10,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T03:10:02.333Z","etag":null,"topics":["forwarder","go","golang","http","ip","proxy","real-ip"],"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/netinternet.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}},"created_at":"2021-05-14T15:19:49.000Z","updated_at":"2024-01-16T01:23:43.000Z","dependencies_parsed_at":"2022-09-10T14:22:33.746Z","dependency_job_id":null,"html_url":"https://github.com/netinternet/remoteaddr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/netinternet/remoteaddr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netinternet%2Fremoteaddr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netinternet%2Fremoteaddr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netinternet%2Fremoteaddr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netinternet%2Fremoteaddr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netinternet","download_url":"https://codeload.github.com/netinternet/remoteaddr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netinternet%2Fremoteaddr/sbom","scorecard":{"id":680777,"data":{"date":"2025-08-11","repo":{"name":"github.com/netinternet/remoteaddr","commit":"432b11cac01e244f0e8cbc6dc6d30d4b39601ba5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"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":"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":"Code-Review","score":1,"reason":"Found 1/9 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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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"}},{"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"}}]},"last_synced_at":"2025-08-21T23:05:46.459Z","repository_id":51322567,"created_at":"2025-08-21T23:05:46.459Z","updated_at":"2025-08-21T23:05:46.459Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"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":["forwarder","go","golang","http","ip","proxy","real-ip"],"created_at":"2026-01-26T14:33:52.347Z","updated_at":"2026-01-26T14:33:52.414Z","avatar_url":"https://github.com/netinternet.png","language":"Go","readme":"# remoteaddr\nGo http real ip header parser module\n\nA forwarders such as a reverse proxy or Cloudflare find the real IP address from the requests made to the http server behind it. Local IP addresses and CloudFlare ip addresses are defined by default within the module. It is possible to define more forwarder IP addresses.\n\nIn Turkey, it is obligatory to keep the port information of IP addresses shared with cgnat by the law no 5651. For this reason, dst port information is also given along with the IP addresses. **If the IP address is behind a proxy, the dst port information is returned as -1.**\n\n## Usage\n\n```\ngo get -u github.com/netinternet/remoteaddr\n```\n\n```go\n// remoteaddr.Parse().IP(*http.Request) return to string IPv4 or IPv6 address\n```\n\n## Example\n\nRun a simple web server and get the real IP address to string format\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/netinternet/remoteaddr\"\n)\n\nfunc root(w http.ResponseWriter, r *http.Request) {\n\tip, port := remoteaddr.Parse().IP(r)\n\tfmt.Fprintf(w, \"Your IP address is \"+ip+\" and dst port \"+port)\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/\", root)\n\tlog.Fatal(http.ListenAndServe(\":8081\", nil))\n}\n\n```\n\n## Example 2 (Nginx or another web service forwarder address)\n\n**AddForwarders([]string{\"8.8.8.0/24\"})** = Add a new multiple forwarder prefixes\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/netinternet/remoteaddr\"\n)\n\nfunc root(w http.ResponseWriter, r *http.Request) {\n\tip, port := remoteaddr.Parse().AddForwarders([]string{\"8.8.8.0/24\"}).IP(r)\n\tfmt.Fprintf(w, \"Your IP address is \"+ip+\" and dst port \"+port)\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/\", root)\n\tlog.Fatal(http.ListenAndServe(\":8081\", nil))\n}\n\n```\n\n## Example 3 (Add an alternative header for real IP address)\n\n**AddHeaders([]string{\"True-Client-IP\"})** = Add a new multiple real ip headers\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/netinternet/remoteaddr\"\n)\n\nfunc root(w http.ResponseWriter, r *http.Request) {\n\tip, port := remoteaddr.Parse().AddHeaders([]string{\"True-Client-IP\"}).IP(r)\n\tfmt.Fprintf(w, \"Your IP address is \"+ip+\" and dst port \"+port)\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/\", root)\n\tlog.Fatal(http.ListenAndServe(\":8081\", nil))\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetinternet%2Fremoteaddr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetinternet%2Fremoteaddr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetinternet%2Fremoteaddr/lists"}