StunServer
Stun 服務器
npm下載stun包
npm i stun -s
google stun服務器
google的stun的服務器一般國內訪問較慢,所以一般自己搭建一個服務器
const stun = require('stun');
stun.request('stun.l.google.com:19302',(err,res)=>{
if(err){
console.log(err);
}else{
const {adress}=res.getXorAddress();
console.log(res);
console.log('you ip',adress);
}
})

浙公網安備 33010602011771號