{"id":25411712,"url":"https://github.com/koho/nat1","last_synced_at":"2026-05-29T03:31:33.042Z","repository":{"id":186476507,"uuid":"675237744","full_name":"koho/nat1","owner":"koho","description":"Expose your local service to Internet in NAT1 network.","archived":false,"fork":false,"pushed_at":"2025-11-28T13:04:42.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-17T09:12:34.359Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koho.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-06T08:48:35.000Z","updated_at":"2025-11-28T13:04:46.000Z","dependencies_parsed_at":"2024-01-01T10:23:35.498Z","dependency_job_id":"f3399c4e-9a46-429f-b73b-63aa5ae7206c","html_url":"https://github.com/koho/nat1","commit_stats":null,"previous_names":["koho/nat1s","koho/nat1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koho/nat1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fnat1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fnat1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fnat1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fnat1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koho","download_url":"https://codeload.github.com/koho/nat1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fnat1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33635961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-02-16T10:19:19.984Z","updated_at":"2026-05-29T03:31:33.029Z","avatar_url":"https://github.com/koho.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nat1\n\nExpose your local service to Internet in NAT1 network.\n\n* Maintain the mapped address automatically.\n* Bind the mapped address to SVCB record.\n* Support both TCP and UDP.\n\n## Single mapping\n\nInstall the command line tool:\n\n```shell\ngo install github.com/koho/nat1/cmd/nat1@latest\n```\n\n### Zero config\n\nA NAT entry is automatically created on gateway.\n\nNote: The gateway needs to have UPnP enabled.\n\n```shell\n# export local port 3389\nnat1 tcp 3389\n```\n\n### Manual config\n\nCreate a public address mapping only. You need to manually configure the local address mapping on gateway (See [Port forwarding](#port-forwarding)).\n\n```shell\n# random local port\nnat1 tcp\n# fixed local port\nnat1 tcp -l :5000\n```\n\n## Multiple mappings\n\nBind the mapped address to DNS SVCB record. Currently only `dnspod` is supported.\n\nInstall the command line tool:\n\n```shell\ngo install github.com/koho/nat1/cmd/nat1s@latest\n```\n\nAn example config file:\n\n```json\n{\n  \"dns\": \"xxx.dnspod.net:53\",\n  \"dnspod\": {\n    \"secret_id\": \"\",\n    \"secret_key\": \"\"\n  },\n  \"service\": [\n    {\n      \"domain\": \"svc1.example.com\",\n      \"local\": \"0.0.0.0:50000\",\n      \"alpn\": [\"wg\"],\n      \"network\": \"udp\"  \n    },\n    {\n      \"domain\": \"svc2.example.com\",\n      \"local\": \"0.0.0.0:50001\",\n      \"alpn\": [\"h2\"],\n      \"hint\": true,\n      \"network\": \"tcp\"\n    }\n  ]\n}\n```\n\nRun the service with the following command:\n\n```shell\nnat1s config.json\n```\n\n### Port forwarding\n\nFor each service, add corresponding forwarding rules to the router.\n\n```shell\nsudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 50001 -j DNAT --to-destination 192.168.1.55:443\n```\n\n### Lookup domain\n\nYour can find your mapped address using `dig` or https://www.nslookup.io/svcb-lookup/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoho%2Fnat1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoho%2Fnat1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoho%2Fnat1/lists"}