Firefox 및 Chrome은 WEBRTC를 지원하여 STUN 서버에서 요청하고 내부 및 외부 네트워크 IP를 반환합니다. XMLHTTPREQUEST 요청과 달리 STUN 요청 개발자 도구에는 네트워크 요청을 볼 수 없습니다.
// AccountFunction getips (콜백)와 관련된 IP 주소를 가져옵니다. // Firefox 및 Chrome var rtcpeerconnection = Window.rtcpeerconnection || Window.mozrtcpeerconnection || Window.webkitrtcpeerconnection; var mediaconstraints = {선택 사항 : [{rtpdatachannels : true}]}; // firefox는 이미 다음과 같은 정보를 기본적으로 스턴 서버를 가지고 있습니다 : config // media.peerconnection.default_iceservers = // [{ "url": "stun : stun.services.mozilla.com"}] var servers = undrefined; // chrome if (wind // 새로운 rtcpeerconnection var pc = 새로운 rtcpeerconnection (서버, mediaconstraints)을 구성합니다. // 후보 이벤트를 듣습니다. // if (ip_dups [ip_addr] === undefined) 콜백 (ip_addr); ip_dups [ip_addr] = true; }}; // 가짜 데이터 채널 생성 PC.createdAtAchannel ( ""); // 제안을 작성 SDP PC.createOffer (function (result) {// stun 서버 요청 PC.setLocalDescription (result, function () {});}, function () {});} // 테스트 : IP 주소를 콘솔에 인쇄합니다 (function (ip) {console.log (ip);});위의 기사 JS는 프록시와 VPN을 우회하여 실제 IP 및 인트라넷 IP를 얻습니다. 역 추적 방법은 내가 공유하는 모든 컨텐츠입니다. 나는 당신이 당신에게 참조를 줄 수 있기를 바랍니다. 그리고 당신이 wulin.com을 더 지원할 수 있기를 바랍니다.