准备工作: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