NAT traversal with Java

前端 未结 3 824
死守一世寂寞
死守一世寂寞 2021-01-01 04:47

I want to connect to computers, each one of them behind a NAT router. I read that STUN only works with one computer behind a NAT router. Is that true? If so, how can I solve

相关标签:
3条回答
  • 2021-01-01 05:07

    TURN is a set of extensions to STUN that help to solve the double-NAT problem. You still need a server in the cloud, and the clients need to register. Source for some free servers is available.

    From the TURN internet draft:

    As described in [RFC5128] and [RFC4787], hole punching techniques
    will fail if both hosts are behind NATs that are not well-behaved. For example, if both hosts are behind NATs that have a mapping behavior of "address dependent mapping" or "address and port dependent mapping", then hole punching techniques generally fail.

    0 讨论(0)
  • 2021-01-01 05:11

    UDP hole punching and TCP hole punching

    0 讨论(0)
  • 2021-01-01 05:17

    If you dó not have a central server, you May consider using upnp if available to create a hole in the router. Azureus/vuze does this.

    0 讨论(0)
提交回复
热议问题