当前位置:首页 > 记录 > 正文内容

chrome和firefox关闭webrtc

4年前 (2021-09-02)记录

Firefox可在浏览器上输入:about:config。之后搜索:media.peerconnection.enabled。找到它后双击,将其改成 false 即可。

chrome在webstory搜索webrtc





原理可以参考一下这里: https://github.com/diafygi/webrtc-ips

或者直接把下面这段代码放在chrome的console里运行一下,就知道自己的真实IP了。

//get the IP addresses associated with an account 
function getIPs(callback){ 
var ip_dups = {};
//compatibility for firefox and chrome 
var RTCPeerConnection = window.RTCPeerConnection 
|| window.mozRTCPeerConnection 
|| window.webkitRTCPeerConnection; 
var mediaConstraints = { 
optional: [{RtpDataChannels: true}] 
};
//firefox already has a default stun server in about:config 
// media.peerconnection.default_iceservers = 
// [{"url": "stun:stun.services.mozilla.com"}] 
var servers = undefined;
//add same stun server for chrome 
if(window.webkitRTCPeerConnection) 
servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};
//construct a new RTCPeerConnection 
var pc = new RTCPeerConnection(servers, mediaConstraints);
//listen for candidate events 
pc.onicecandidate = function(ice){
//skip non-candidate events 
if(ice.candidate){
//match just the IP address 
var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/ 
var ip_addr = ip_regex.exec(ice.candidate.candidate)[1];
//remove duplicates 
if(ip_dups[ip_addr] === undefined) 
callback(ip_addr);
ip_dups[ip_addr] = true; 
} 
};
//create a bogus data channel 
pc.createDataChannel("");
//create an offer sdp 
pc.createOffer(function(result){
//trigger the stun server request 
pc.setLocalDescription(result, function(){}, function(){});
}, function(){}); 
}
//Test: Print the IP addresses into the console 
getIPs(function(ip){console.log(ip);});





参考:https://www.cnblogs.com/xuan52rock/p/11249083.html

相关文章

WIN2008增加虚拟内存

参考:https://jingyan.baidu.com/article/75ab0bcbce4c27d6864db2ff.html我的电脑-右键属性-高级系统设置-高级-设置-虚拟内存那里点击更改把...

广告术语

广告订单 (IO)直接反应 (DR)一种旨在使消费者产生即时行动的营销类型。这可能包括点击次数、网站访问量或购买次数。这些行为中的每一项都可被衡量并归因于单个广告或广告活动。每次结果成本: ...

Linux系统安装wget命令

参考:https://blog.csdn.net/csdn_heliu/article/details/90052647debian 或者 ubuntu : sudo apt-get install...

安卓手机免root搭建青龙面板各种记录

安卓手机免root搭建青龙面板各种记录

记录一下,免的下次手贱还想折腾百度一下知道了基本流程1,下载软件ZeroTermux和青龙面板恢复包2,安装青龙面板恢复包3,启动青龙面板4,设置青龙面板5,拉库6,提取cookies7,设置微信机器...

Cachify插件的一些转载

以下来源于:https://www.xiapilu.com/web/web-tutorial/cachify-accelerate-website-wordpress.htmlhttps://www....

Microsoft office E5 各种各种各种

注意点1:如果有合适的网络环境注册会很顺利,如果没有,会出现什么现在不能创建沙盒之类的莫名其妙的问题,如果可以,尽量早上注册,实际测试晚上的速度相当让人爆炸注意点2:有的token只会出现一次,最好出...