Stable way of retrieving the external IP for a host behind a NAT

后端 未结 2 1011
忘掉有多难
忘掉有多难 2021-01-26 08:29

Basically I want to display a hosts external public facing IP address regardless of whether or not it is part of a natted lan. What I\'m doing now is just connecting to myipaddr

2条回答
  •  一整个雨季
    2021-01-26 09:09

    STUN RFC 3489will do it, though you need access to an open STUN server. There are other sites (like myipaddress.com) that will report your apparent address back to you, but there is no "standard" service for this.

提交回复
热议问题