{"id":27968870,"url":"https://github.com/dxcweb/go-nat-hole","last_synced_at":"2025-05-07T21:07:33.661Z","repository":{"id":47595540,"uuid":"138685236","full_name":"dxcweb/go-nat-hole","owner":"dxcweb","description":"解决外网向内网p2p通信方案--NAT穿透。","archived":false,"fork":false,"pushed_at":"2018-06-29T07:16:26.000Z","size":4249,"stargazers_count":36,"open_issues_count":2,"forks_count":14,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T21:07:27.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dxcweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-26T04:35:56.000Z","updated_at":"2024-10-29T12:28:08.000Z","dependencies_parsed_at":"2022-07-26T15:45:11.914Z","dependency_job_id":null,"html_url":"https://github.com/dxcweb/go-nat-hole","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcweb%2Fgo-nat-hole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcweb%2Fgo-nat-hole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcweb%2Fgo-nat-hole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcweb%2Fgo-nat-hole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxcweb","download_url":"https://codeload.github.com/dxcweb/go-nat-hole/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954425,"owners_count":21830905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-05-07T21:07:32.984Z","updated_at":"2025-05-07T21:07:33.641Z","avatar_url":"https://github.com/dxcweb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-nat-hole\n``\n服务器：启动intermediary服务\nB-\u003e服务器：告诉服务器B的名称\n\bA-\u003e服务器:我需要链接B的xx端口（服务器获取NAT-A的端口ip）\n服务器-\u003eB：NAT-A:端口需要和你链接并代理到ip：端口\nB:启动一个UDP服务\nB-\u003eNAT-A:udp send空消息\nB-\u003e服务器：udp send 说我已经准备好了，叫A来连我吧（服务器获取NAT-B的端口ip）\n服务器-\u003eA:告诉NAT-B的ip和端口\nA-\u003eNAT-B:开始通讯\n``\n\n## build\n``\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./bootstrap/intermediary/main.go\n``\n\n\n## NAPT分了两个大的类型\n``\nSymmetric NAT型 (对称型) 需要预测端口，疯狂尝试连接才能打洞成功。暂时不实现吧\nCone NAT型（圆锥型）可以打洞\n\n``","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxcweb%2Fgo-nat-hole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxcweb%2Fgo-nat-hole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxcweb%2Fgo-nat-hole/lists"}