Vpn interface
For vpn session configuration use class SessionConfig
Available Builder
methods
withTransport
- set transport name to start session with. Can be used in case multiple transports availablewithPolicy
- define app policy to use.AppPolicy.forAll
- vpn will be available for all appsAppPolicy.Builder.policy
withAppPolicy.POLICY_FOR_LIST
- apps list allowed to use vpnAppPolicy.Builder.policy
withAppPolicy.POLICY_EXCEPT_LIST
- apps list not allowed to use vpn
withReason
- define reason for starting sessionunified.vpn.sdk.TrackingConstants.GprReasons
. Will be used in analyticswithLocation
- define virtual location for sessionwithCountry
- define virtual country for sessionwithPrivateGroup
- define private server for sessionwithVpnParams
- define vpn tunnel params. Like dns servers, additional routes.addDnsRule
- add dns rule for session. More on Traffic rules page. For Hydra transport only.addProxyRule
- add proxy rule for session. More on Traffic rules page. For Hydra transport only.withFireshieldConfig
- define categorisation service rules (more on Fireshield resource page). For Hydra transport onlywithTransportFallback
- define the order of transports to fallback when some error happen.keepVpnOnReconnect
- enables the kill switch - no traffic will be allowed while sdk is in connection process or handling the connection error.
Examples:
Start VPN with an optimal server
Start VPN for chrome only
Analytics reasons
M_UI
- manually from uiM_SYSTEM
- manually from systemM_OTHER
- manually from another placeA_APP_RUN
- auto on app runA_RECONNECT
- auto on reconnectA_ERROR
- auto after errorA_SLEEP
- auto after sleepA_NETWORK
- auto on network eventA_OTHER
- auto on other reason
Start VPN session
Stop vpn
Restart vpn
Will restart vpn session with new config without IDLE state
Update session config
Can update some vpn session configs without restarting vpn session.
SDK now support update for transport hydra only:
Fireshield rules
DNS Rules
Proxy Rules
Listen for vpn status and traffic updates
Get Current vpn state
VpnState
IDLE - no active vpn session.
CONNECTING_PERMISSIONS - requesting system vpn permission
CONNECTING_CREDENTIALS - loading backend information to establish connection
CONNECTING_VPN - transport connection in progress
DISCONNECTING - disconnection started
CONNECTED - vpn session is active and connected
PAUSED - VPN session paused due to error, network change, waiting to restore vpn session
UNKNOWN - not used, reserved
ERROR - not used, reserved
Call VPN permission dialog without connecting to vpn
Get current VPN session information
Last updated