我正在开发一个加密聊天程序,并试图找到一种在两台被路由器隐藏的计算机之间直接发送消息的方法(每台计算机都有自己的本地 IP 地址,并且没有端口转发),由服务器管理连接。
这是一个简单的模型:
1. Computer A and Computer B both connect to the server
2. Computer B tells server that it is hosting a session
3. Computer A asks server to join computer B's session
4. Server tells Computer B to accept connections from Computer A - Is this needed?
5. Server tells Computer A how to connect to Computer B
6. Computer A connects to computer B
7. Connection established, able to send TCP messages between computers over stream
(Could UDP be possible?)
我的问题是:使用 NAT 在互联网上可以实现吗?如何实现?
答案:打孔。谢谢,radicetrentasei