mullvad / mullvadvpn-app

The Mullvad VPN client app for desktop and mobile
https://mullvad.net/
GNU General Public License v3.0
5.07k stars 336 forks source link

[Feature Request] show download upload speed and total usage #2012

Open sajjadintel opened 4 years ago

sajjadintel commented 4 years ago

Hi, I want to show network download upload (RX TX) and total usage since connected. I want to add this feature myself but i have no idea where to start from? if someone could help i can add this feature or add it yourself. thanks.

faern commented 4 years ago

It would not be very trivial to add. First you need to find a way to either extract this from OpenVPN and WireGuard. Or you would need to do it from the tunnel interface. But then there would be platform dependent implementations for each platform. And after that it has to be continuously sent to the frontend(s) and displayed there. So it would also require some UI/UX thought, and currently I'm not sure if we want to complicate the UI with this info, it would require some planning at least.

But thanks for the suggestion.

sajjadintel commented 4 years ago

if i want to add it for wiregaurd where should i start from?

faern commented 4 years ago

We already have code for extracting the number of bytes passed through the tunnel for WireGuard. We use this to detect if the tunnel is inactive or not. See https://github.com/mullvad/mullvadvpn-app/blob/bcd90f658557b7a01e03eb97d9d21ef817e4b07a/talpid-core/src/tunnel/wireguard/wireguard_go.rs#L290. You could probably use that same mechanism to periodically extract how much traffic passed and channel it out to wherever you want to display it.

Please keep in mind that we might not accept merging this upstream. The frontend designers might not want this to take up space in the frontend. And we might not want to take maintenance responsibility for the code overall. Just so you know.