Provide an API or local method to retrieve the VPN port forwarding port programmatically
Hello,
I use the Proton VPN Windows application together with the port forwarding feature on P2P servers, and I keep a torrent client connected through it. Like many users, I wrote a small script that keeps the client listening port in sync with the port assigned by Proton, because that port changes on every reconnection.
The problem: on Windows there is no reliable way for an external tool to know the assigned port. The application offers no command line interface, no local API, and no configuration file exposing it. Today, community scripts have only one option: parse the Windows notifications database (wpndatabase.db) and extract the port from the text of the notification raised by the app. This works, but it is fragile by design: it depends on the exact wording and binary format of notifications, it breaks if notifications are disabled by the user or by a policy, and it can miss the port entirely if a notification is dismissed at the wrong moment.
On Linux, the Proton VPN app already writes the forwarded port to a well-known location (/run/user/UID/Proton/VPN/forwarded_port), and the NAT-PMP gateway is reachable for manual setups. Windows users have no equivalent.
I would like to request one of the following, in order of preference:
- A documented local method on Windows, equivalent to the Linux forwarded_port file: a small file or registry key under the user profile, updated by the app whenever the port is assigned or renewed.
- A minimal local HTTP or named pipe API on localhost, read-only, returning the current port and the VPN connection state.
- Even a simple documented command line flag, such as a "port" command printing the current forwarded port and exiting, would solve most use cases. Use cases beyond torrent clients are numerous: keeping game server ports in sync, home automation scripts, status dashboards, remote access tools. Every user who relies on port forwarding currently has to reinvent a notifications-parsing script that will eventually break.
Thank you for considering this.
Traduction française (référence