{"id":49033320,"url":"https://github.com/1mb-dev/natcheck","last_synced_at":"2026-04-26T11:01:21.654Z","repository":{"id":352370334,"uuid":"1214895446","full_name":"1mb-dev/natcheck","owner":"1mb-dev","description":"NAT type diagnosis CLI. One command tells you why your WebRTC, P2P, or VPN connections struggle — and whether TURN is required.","archived":false,"fork":false,"pushed_at":"2026-04-19T09:02:02.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-19T10:30:15.138Z","etag":null,"topics":["cli","go","nat","networking","p2p","rfc-5780","stun","webrtc"],"latest_commit_sha":null,"homepage":"https://1mb-dev.github.io/natcheck/","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/1mb-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-19T07:35:35.000Z","updated_at":"2026-04-19T09:02:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/1mb-dev/natcheck","commit_stats":null,"previous_names":["1mb-dev/natcheck"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/1mb-dev/natcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mb-dev%2Fnatcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mb-dev%2Fnatcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mb-dev%2Fnatcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mb-dev%2Fnatcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1mb-dev","download_url":"https://codeload.github.com/1mb-dev/natcheck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mb-dev%2Fnatcheck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32294591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"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":["cli","go","nat","networking","p2p","rfc-5780","stun","webrtc"],"created_at":"2026-04-19T10:01:34.323Z","updated_at":"2026-04-26T11:01:21.648Z","avatar_url":"https://github.com/1mb-dev.png","language":"Go","funding_links":[],"categories":["Server Software","Tools","Stun \u0026 Turn"],"sub_categories":["STUN/TURN","C/C++"],"readme":"# natcheck\n\nNAT type diagnosis CLI. One command tells you why your WebRTC, P2P, or VPN connections struggle — and whether TURN is required.\n\nBuilt on [`pion/stun`](https://github.com/pion/stun). Pure Go, single static binary. No cgo, no services, no config.\n\n\u003e v0.1.2. Spec: [`docs/design.md`](docs/design.md). Samples: [`docs/samples/`](docs/samples/).\n\n## Why natcheck\n\n- **One command, one answer.** No more piecing together `stun-client` output with a dusty online NAT classifier and RFC 5780.\n- **Honest outputs.** Reports `unknown` when classification can't be determined from the data, rather than guessing.\n- **Human-readable by default, `--json` on request.** Clean output for terminals, schema-stable JSON for CI.\n\n## Quick start\n\n**Homebrew (recommended on macOS):**\n\n```bash\nbrew tap 1mb-dev/tap\nbrew install natcheck\n```\n\n**Go install (any platform with Go 1.25+):**\n\n```bash\ngo install github.com/1mb-dev/natcheck/cmd/natcheck@latest\n```\n\nThen run:\n\n```bash\nnatcheck\n```\n\nExample output on a healthy home network:\n\n```\nDirect P2P: likely\nNAT type: Endpoint-Independent Mapping (cone)\nPublic endpoint: 203.0.113.45:51820\n\nProbes:\n  stun.l.google.com:19302   rtt=24ms  mapped=203.0.113.45:51820\n  stun.cloudflare.com:3478  rtt=31ms  mapped=203.0.113.45:51820\n\nFiltering not tested.\n```\n\nThe `Direct P2P:` line leads so you get the answer on line 1.\n\nPointing `--server` at a STUN server that advertises `OTHER-ADDRESS` (e.g. coturn — see [`docs/coturn-setup.md`](docs/coturn-setup.md)) adds a one-line `Filtering:` verdict per RFC 5780 §4.4. Default servers (Google, Cloudflare) don't, so filtering classification is skipped and adds zero latency for default-server users.\n\n## Flags\n\n| Flag | Purpose |\n|------|---------|\n| `--json` | Emit JSON instead of human-readable report |\n| `--verbose` | Log each STUN transaction to stderr |\n| `--server host:port` | Add a custom STUN server (repeatable; overrides defaults) |\n| `--timeout duration` | Total probe timeout (default `5s`) |\n| `--version` | Print version and exit |\n| `--help` | Print flag reference |\n\n## Exit codes\n\n| Code | Meaning | When |\n|------|---------|------|\n| `0` | P2P-friendly | `Direct P2P: likely` or `possible` |\n| `1` | P2P-hostile | `Direct P2P: unlikely` or `unknown` |\n| `2` | Probe or flag error | All probes failed, invalid flag, or bad `--server` |\n\nScripts that ask \"did the tool run?\" check `$? -ne 2`. Scripts that ask \"can I use direct P2P?\" check `$? -eq 0`.\n\n## CI usage\n\n```bash\nverdict=$(natcheck --json | jq -r '.webrtc_forecast.direct_p2p')\nif [ \"$verdict\" != \"likely\" ]; then\n  echo \"NAT not P2P-friendly: $verdict\"\n  exit 1\nfi\n```\n\nThe `--json` schema (`nat_type`, `public_endpoint`, `probes[]`, `webrtc_forecast`, `warnings[]`, `filtering`) is a public contract from v0.1 onward — additive changes only after release. Real captures live under [`docs/samples/`](docs/samples/).\n\n## Scope\n\nnatcheck classifies NAT mapping behavior (Endpoint-Independent, Address-Dependent, Address-and-Port-Dependent per RFC 5780) and reports a WebRTC direct-P2P forecast. Filtering behavior (RFC 5780 §4.4) is classified when the configured `--server` advertises `OTHER-ADDRESS`; otherwise the verdict is `untested`. Hairpinning is out of scope. On CGNAT networks (`100.64.0.0/10`), the forecast is `unknown`. IPv6 works when the network supports it but is not exhaustively tested.\n\nSee [`docs/design.md`](docs/design.md) for full architecture and testing details.\n\n## Acknowledgements\n\nDefault STUN servers courtesy of Google (`stun.l.google.com:19302`) and Cloudflare (`stun.cloudflare.com:3478`). For high-frequency automation, self-host [coturn](https://github.com/coturn/coturn) and pass it via `--server`.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1mb-dev%2Fnatcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1mb-dev%2Fnatcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1mb-dev%2Fnatcheck/lists"}