The usual approach:
1) The user opens a VPN client that provides a connection to the VPN
2) The user uses the application.
Alternative approach:
If you are developing an enterprise application, then you could start and stop the VPN connection directly from the application using private private api.
Advantages of the approach :
Thus, all network connections from the application are routed through the VPN, and the user does not need to enable the VPN connection each time he uses the application.
Reference:
You can find heated discussions on this topic in the following streams.
Theme 1
Theme 2
Theme 3
source share