1

What would be the cleanest way to infer that a WebRTC connection is either being established or is active.

e.g. maybe there is a way to query the browser, or can one tell by actively monitoring connections? (Can one even detect UDP traffic?)

So far I've been looking at netstat -atp tcp but I can't see any pattern yet which could be used.

reinier
  • 261
  • 2
  • 10

1 Answers1

1

See the article How do you find the current active connection in webrtc-internals?

Here is a summary for Chrome and for a simplified example :

  • Open chrome://webrtc-internals. The active candidate pair will be shown in bold and may have been renamed to Conn-audio-1-0.
  • Expand this to see the candidates
  • The googActiveConnection is true for the currently active connection and false for all others.
  • The active connection is defined by the local and remote specified in the localCandidateId and remoteCandidateId fields.
  • You may now examine their attributes.

You will find much more details and screenshots in the article.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • Even though this is a great answer, I don't know if this is scriptable, and/or would also translate to other browsers. – reinier Apr 06 '23 at 20:42
  • See [this article](https://blog.mozilla.org/webrtc/new-tool-debugging-webrtc/) for Firefox. – harrymc Apr 06 '23 at 20:46