Can I get my IP address in a chrome app without using an external service?

前端 未结 3 399
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-22 06:29

I am building a chrome app and created a UDP socket via the chrome socket api.

Is there a way to retrieve your own IP address without u

3条回答
  •  醉酒成梦
    2021-01-22 06:59

    An unconnected socket does not have a local address yet, unless it is specifically bound to an address . It only gets a local and remote address once the socket is connected (TCP) or you send data through the socket (UDP). And it only gets the IP address of the local machine, whereas an external service sees the internet-facing external address of the router if you are behind some NAT router (i.e. most home users).

提交回复
热议问题