How to find out the server IP address (using JavaScript) that the browser is connected to?

前端 未结 10 2198
说谎
说谎 2020-12-29 04:20

Is there any way you can find the IP of the server that the browser is connected to? For e.g. if the browser is accessing http://www.google.com, can we tell in any way what

10条回答
  •  攒了一身酷
    2020-12-29 04:39

    You cannot get this in general. From Javascript, you can only get the HTTP header, which may or may not have an IP address (typically only has the host name). Part of the browser's program is to abstract the TCP/IP address away and only allow you to deal with a host name.

提交回复
热议问题