Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do network tracking or debugging WebRTC peer-to-peer connection

I am wondering that there is the tool or any method I can see what underlying WebRTC peer-to-peer connection?

For simple example, if I am implementing video chat using webrtc, all connection (offer, answer, ice) are established but I can't see the video streaming, how can I debug and see that there is any packet or something sending between these two peers or not.

like image 922
A-letubby Avatar asked Jul 08 '13 15:07

A-letubby


People also ask

How does WebRTC peer-to-peer work?

In webRTC, communication happens to be in P2P connection, rather than the client-server connection. The connection is equally distributed among the two communicating agents through their transport addresses.

Is WebRTC peer-to-peer?

WebRTC is a peer-peer communication protocol.

How do I check WebRTC connection?

If you're using Chrome, you can navigate to chrome://webrtc-internals . This will show you the offer, answer, ICE states, and statistics about the connection (once it has been established).


2 Answers

If you're using Chrome, you can navigate to chrome://webrtc-internals. This will show you the offer, answer, ICE states, and statistics about the connection (once it has been established).

For more in-depth debugging, you can see logs of all the STUN pings between candidates by starting Chrome with the following flags:

--enable-logging --v=4 

The logs will be in the chrome_debug.log file in your user data directory: http://dev.chromium.org/user-experience/user-data-directory

like image 61
tomtheengineer Avatar answered Sep 27 '22 21:09

tomtheengineer


There are ways to debug underlying connection status. If you are using a web application, you can navigate to browser statistics. For chrome, chrome://webrtc-internals (API structure). This thread can be helpful too(using peerJs). For firefox, browse to about:webrtc.

For native applications, i.e for windows you have take the log from compiler itself. In MS Visual Studio 2015, try Debug > Attach Process > your native application PID, Debug>windows>output.

like image 41
Anirban Avatar answered Sep 27 '22 21:09

Anirban