Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

314
Views
How to mock webrtc local and public ip

Does anyone have an idea How to mock webrtc local and public ip?

I can see in some softwares like multilogin, they are to let you set any value for the local and public ip.

so is there any way to do the same by Javascript or playwright or any other browser automation control on c#

thank you

so far we have tried to use some sample we found in StackOverflow in javascript as below but not working:

function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) {if (!window.RTCPeerConnection) {return;}const proto = window.RTCPeerConnection.prototype;const nativeAddEventListener = proto.addEventListener;proto.addEventListener = function(nativeEventName, cb) {if (nativeEventName !== eventNameToWrap) {return nativeAddEventListener.apply(this, arguments);}const wrappedCallback = (e) => {const modifiedEvent = wrapper(e);if (modifiedEvent) {cb(modifiedEvent);}};this._eventMap = this._eventMap || {};this._eventMap[cb] = wrappedCallback;return nativeAddEventListener.apply(this, [nativeEventName,wrappedCallback]);};

const nativeRemoveEventListener = proto.removeEventListener;proto.removeEventListener = function(nativeEventName, cb) {if (nativeEventName !== eventNameToWrap || !this._eventMap|| !this._eventMap[cb]) {return nativeRemoveEventListener.apply(this, arguments);}const unwrappedCb = this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this, [nativeEventName,unwrappedCb]);};

Object.defineProperty(proto, 'on' + eventNameToWrap, {get() {return this['_on' + eventNameToWrap];},set(cb) {if (this['_on' + eventNameToWrap]) {this.removeEventListener(eventNameToWrap,this['_on' + eventNameToWrap]);delete this['_on' + eventNameToWrap];}if (cb) {this.addEventListener(eventNameToWrap,this['_on' + eventNameToWrap] = cb);}},enumerable: true,configurable: true});}

wrapPeerConnectionEvent(window, 'icecandidate', (e) => {

//console.log(e);if (e.candidate) {

const parts = e.candidate.candidate.split(' ');

parts[4] = '127.0.0.1'; // replace the local ip with 127.0.0.1

parts[9] = '65.65.0.0'e.candidate.candidate = parts.join(' ');

console.log(parts);

console.log(e.candidate.candidate);}return e;})
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!