.Net WCF NAT 穿越的最佳实践
我正在寻找 .Net 中点对点 NAT 遍历的建议或解决方案。假设我有一个聊天应用程序,需要连接两个客户端,但两者都位于 NAT 后面:
对于家庭场景,uPNP 可能没问题,因为只涉及电缆调制解调器或消费者路由器。但是,对于无法使用 uPNP 的企业环境呢?
我熟悉 UDP 打洞,这对于握手来说是可以的,但我不想依赖它来传输真实的应用程序数据。
我还研究了 IPv6 和 Teredo,但我不确定每个客户端都具有 IPv6 可用性,而且对于所有 Teredo 要求(服务器、中继等)有点令人困惑。
现在是 2011 年,IM/Chat 客户端已经出现十年了,然后又过了一些年 - 所以我相信这个问题已经解决了很多次。有人可以推荐这个领域的最佳实践吗?提前致谢!
I'm looking for suggestions or a solution for peer-to-peer NAT traversal in .Net. Say I have a chat application and two clients need to connect but both are behind NAT:
For home scenarios, uPNP is probably ok since only a cable modem or consumer router is involved. But what about corporate environments where uPNP isn't possible?
I'm familiar with UDP hole-punching which is OK for handshaking but I'd rather not rely on it for transmitting real application data.
I also looked into IPv6 and Teredo but I'm not confident that every client would have IPv6 availability, and it's a bit confusing as to all the Teredo requirements (servers, relays, etc.)
It's 2011 and IM/Chat clients have been around for a decade and then some - so I gotta believe this issue has been resolved many times over. Can anyone recommend best practices i this area? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XMPP 支持通过 NAT 穿越进行聊天,并且有多个 .NET 开源客户端。使用任何 XMPP 服务器,例如 OpenFire。
XMPP supports chat with NAT traversal, and there are several open-source clients for .NET. Use any XMPP server, such as OpenFire.