1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 如何用js获取本机局域网的IP地址

如何用js获取本机局域网的IP地址

时间:2021-07-17 03:39:57

相关推荐

如何用js获取本机局域网的IP地址

准备工作:chrome 浏览器,修改配置.

地址栏:

chrome://flags/;

然后:

Anonymize local IPs exposed by WebRTC.

设置为disable

点击relaunch;

接下来.

把下面的代码存为html页。

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>

<body>

<h4>Your local IP addresses:</h4>

<ul></ul>

<h4>Your public IP addresses:</h4>

<ul></ul>

<script>

//get the IP addresses associated with an account

function getIPs(callback){

var ip_dups = {};

//compatibility for firefox and chrome

var RTCPeerConnection = window.RTCPeerConne

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。