TL;DR: Make KDE Connect to work across different networks/NATs without complex VPNs or manual configuration by Integrating libp2p as a new backend to handle automatic hole punching, relaying, and encryption. Benefits - Provides a “it just works” experience, enables features like a WebRTC-based web interface. Trade-off: opt-in feature to balance increased battery/resource usage (maybe?) with seamless connectivity over internet/across networks.
Hi All,
currently one of the frustrating issues with KDE Connect was having to be on same network without per-device Isolation. I get that this is to avoid exposing it to internet, and to totally avoid interacting with third party server, but it still feels limiting.
Even soutions like Tailscale is not the best as most normal users don’t even know about it, and even for experienced devs, it’s clunkly solution as it’s normally constantly fight with other VPNs, like consumer ones or work related ones.
I have been trying to overcome this for years now, and tried ideas like having a web interface for kde connect. - GitHub - Vaisakhkm2625/kde_connect_webapp_poc: a web interface for kde connect, using tailscale · GitHub
and over the years people are tried to sovle this multiple times - Relay Servers (For When Users Is Behind Firewall/VPN) . I know a bluetooth backend development is going on, but it doesn’t provide the same experience as wifi. especially on travel.
But recently i came across this https://libp2p.io/
This is a lib created as a starting point for almost any p2p app, as to avoid reinventing everything from authentication, autherization, encryption to UDP hole punching and relay servers. as most p2p projects like bittorrent reimplimenting these again and again.
This lib has essentially become the backbone of cryto currency projects, so security wise it’s in great shape with constant development.
libp2p has support for anything from raw TCP to websockets and webrtc and much more. by implementing this, we can essentially provide something like a KDE Connect webapp, where a website can connect to our device over webrtc.
I am imagining implementing this as a new backend like libp2pLinkProvider by extending BaseLinkProvider just like how Bluetooth backend or LanBackend, but we don’t even need to handle self-signed certificate exchange or mDNS discovery ourself has it’s handled in the lib itself.
the lib has bindings for almost all languages (for us jvm-libp2p and cpp-libp2p are mature as well.. )
drawbacks
- Biggest drawback is that, it’s little on the heavier side, as it’s keep a constant stream of rather than sending each packet sperately (so keep-alives can drain battery). but on android side we can configure to be a “DhtClient” (only querying).
- 3rd party lib - I don’t know how much KDE projects like to add 3rd party libs. but in this case, I hope the benefits outweigh the problems by having a battle tested implementation.
- Not everyone appreciate it connecting over internet, so need to make it opt in.