NAT Traversal using only free STUN and TURN server

2019-07-19 11:43发布

问题:

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.

回答1:

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.