在C#中仅使用免费的STUN和TURN服务器进行NAT遍历 [英] NAT Traversal using only free STUN and TURN servers in C#

查看:291
本文介绍了在C#中仅使用免费的STUN和TURN服务器进行NAT遍历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个在线游戏应用程序,该应用程序可以通过Internet与另一台PC进行点对点通信. 由于两台PC都可能处于NAT下,并且由于我负担不起外​​部服务器,因此我认为唯一的方法是使用免费的STUN和TURN服务器,例如解决方案

看看 Internet网关设备协议. Is是UPNP协议的扩展,非常易于使用,几乎所有的路由器都支持它,并且有一些免费的libs实现该协议.

I am trying to make an online game application, which communicates with another pc peer-to-peer over the Internet. Since both pc's are likely to be under NAT, and since I cannot afford an external server, I thought the only way is to use free STUN and TURN server, such as Numb.

However, after some research, I couldn't figure out how to use those servers to make a connection.

Is it really possible to use only those servers to do it? If it is, how would you do that? Or is there an easier way of doing that?

I can use either UDP or TCP for this.

解决方案

Take a look at the Internet Gateway Device Protocol. Is is an extension to the UPNP protocol, is very easy to use, is supported by pretty much every router out there and there are some free libs implementing this protocol.

这篇关于在C#中仅使用免费的STUN和TURN服务器进行NAT遍历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆