Using WebRTC getStats API to detect data sent/received, packets lost/success, ports/network, encryption and more.
You can write iOS or Android apps for this demo as well.