Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何在java中进行NAT隧道UDP打孔?
正因为如此,不同 NAT 后面的 A 和 B 计算机无法接收他们发送给对方的 UDP 包......
我该如何解决这个问题?
您需要一个具有公共 IP 地址的服务器 S。A 和 B 应该打开到 S 的连接。这将在 NAT 中打开一个 UDP 漏洞。然后 S 可以读取 A 和 B 的 NAT 转换地址/端口。然后 S 可以将此信息发送回 A 和 B,他们可以直接在彼此的开放 TCP 端口上开始通信。