Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename connection to tunnel #863

Merged
merged 4 commits into from Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -55,7 +55,7 @@ A Docker image with all pre-requisites for Android builds is included. To build
Additional requirements for Apple:

* An Apple Developer Account. You will need to be invited to join the "Jigsaw Operations LLC" team
* XCode 10+ ([download](https://developer.apple.com/xcode/))
* XCode 11+ ([download](https://developer.apple.com/xcode/))
* XCode command line tools

To build for macOS (OS X), run:
Expand Down
20 changes: 10 additions & 10 deletions apple/xcode/ios/Outline.xcodeproj/project.pbxproj
Expand Up @@ -30,10 +30,10 @@
F8EB0D7A90A642BD93C2F424 /* vpn in Resources */ = {isa = PBXBuildFile; fileRef = E8672BD859474DB9A8434AAC /* vpn */; };
FC0FFD691FCCD45900EB0129 /* Shadowsocks_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC29A6A41FB522E1005E2599 /* Shadowsocks_iOS.framework */; };
FC1FCAE0216D2A6E00F078A5 /* Subnet.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC1FCADE216D2A6E00F078A5 /* Subnet.swift */; };
FC28C298201BB4E9005FD743 /* OutlineConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C295201BB4E9005FD743 /* OutlineConnection.swift */; };
FC28C298201BB4E9005FD743 /* OutlineTunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C295201BB4E9005FD743 /* OutlineTunnel.swift */; };
FC28C299201BB4E9005FD743 /* OutlineVpn.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C297201BB4E9005FD743 /* OutlineVpn.swift */; };
FC28C29A201BB4F3005FD743 /* OutlineConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C295201BB4E9005FD743 /* OutlineConnection.swift */; };
FC28C2B32022268B005FD743 /* OutlineConnectionStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C2B020222681005FD743 /* OutlineConnectionStore.swift */; };
FC28C29A201BB4F3005FD743 /* OutlineTunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C295201BB4E9005FD743 /* OutlineTunnel.swift */; };
FC28C2B32022268B005FD743 /* OutlineTunnelStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C2B020222681005FD743 /* OutlineTunnelStore.swift */; };
FC28C2C3202913C4005FD743 /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; };
FC29A6A61FB522E1005E2599 /* Shadowsocks_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC29A6A41FB522E1005E2599 /* Shadowsocks_iOS.framework */; };
FC8C30DF1FA78FA9004262BE /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C30DE1FA78FA9004262BE /* Sentry.framework */; };
Expand Down Expand Up @@ -159,9 +159,9 @@
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = Outline/config.xml; sourceTree = "<group>"; };
FC1FCADE216D2A6E00F078A5 /* Subnet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Subnet.swift; path = Outline/Resources/vpn/Subnet.swift; sourceTree = SOURCE_ROOT; };
FC28C295201BB4E9005FD743 /* OutlineConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineConnection.swift; path = "cordova-plugin-outline/OutlineConnection.swift"; sourceTree = "<group>"; };
FC28C295201BB4E9005FD743 /* OutlineTunnel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineTunnel.swift; path = "cordova-plugin-outline/OutlineTunnel.swift"; sourceTree = "<group>"; };
FC28C297201BB4E9005FD743 /* OutlineVpn.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineVpn.swift; path = "cordova-plugin-outline/OutlineVpn.swift"; sourceTree = "<group>"; };
FC28C2B020222681005FD743 /* OutlineConnectionStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineConnectionStore.swift; path = Outline/Resources/vpn/OutlineConnectionStore.swift; sourceTree = SOURCE_ROOT; };
FC28C2B020222681005FD743 /* OutlineTunnelStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineTunnelStore.swift; path = Outline/Resources/vpn/OutlineTunnelStore.swift; sourceTree = SOURCE_ROOT; };
FC29A6A41FB522E1005E2599 /* Shadowsocks_iOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Shadowsocks_iOS.framework; path = "Outline/Plugins/cordova-plugin-outline/Shadowsocks_iOS.framework"; sourceTree = "<group>"; };
FC55AB411F4F960A0056F12C /* VpnExtension-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "VpnExtension-Info.plist"; path = "Outline/VpnExtension-Info.plist"; sourceTree = SOURCE_ROOT; };
FC8C30DE1FA78FA9004262BE /* Sentry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sentry.framework; path = "Outline/Plugins/cordova-plugin-outline/Sentry.framework"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -311,7 +311,7 @@
307C750510C5A3420062BCA9 /* Plugins */ = {
isa = PBXGroup;
children = (
FC28C295201BB4E9005FD743 /* OutlineConnection.swift */,
FC28C295201BB4E9005FD743 /* OutlineTunnel.swift */,
FC28C297201BB4E9005FD743 /* OutlineVpn.swift */,
FC8C31081FAA8032004262BE /* OutlineSentryLogger.swift */,
38EC0895182E411AAF640B74 /* CDVDevice.m */,
Expand All @@ -336,7 +336,7 @@
3B03477B1F21337900C8EF1F /* Shadowsocks.m */,
3B0347591F212F2D00C8EF1F /* PacketTunnelProvider.h */,
3B03475A1F212F2D00C8EF1F /* PacketTunnelProvider.m */,
FC28C2B020222681005FD743 /* OutlineConnectionStore.swift */,
FC28C2B020222681005FD743 /* OutlineTunnelStore.swift */,
FC1FCADE216D2A6E00F078A5 /* Subnet.swift */,
3B03475B1F212F2D00C8EF1F /* VpnExtension.entitlements */,
);
Expand Down Expand Up @@ -529,7 +529,7 @@
buildActionMask = 2147483647;
files = (
FC28C299201BB4E9005FD743 /* OutlineVpn.swift in Sources */,
FC28C298201BB4E9005FD743 /* OutlineConnection.swift in Sources */,
FC28C298201BB4E9005FD743 /* OutlineTunnel.swift in Sources */,
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
Expand All @@ -546,11 +546,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FC28C29A201BB4F3005FD743 /* OutlineConnection.swift in Sources */,
FC28C29A201BB4F3005FD743 /* OutlineTunnel.swift in Sources */,
3B03475D1F212F2D00C8EF1F /* PacketTunnelProvider.m in Sources */,
FCABE26121AF5C78009B7C93 /* ShadowsocksConnectivity.m in Sources */,
FC1FCAE0216D2A6E00F078A5 /* Subnet.swift in Sources */,
FC28C2B32022268B005FD743 /* OutlineConnectionStore.swift in Sources */,
FC28C2B32022268B005FD743 /* OutlineTunnelStore.swift in Sources */,
3B03477C1F21337900C8EF1F /* Shadowsocks.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
28 changes: 14 additions & 14 deletions apple/xcode/osx/Outline.xcodeproj/project.pbxproj
Expand Up @@ -30,17 +30,17 @@
FC0799F72037543F00A1C822 /* OutlineLauncher.app in Copy OutlineLauncher */ = {isa = PBXBuildFile; fileRef = FC0799E62037532900A1C822 /* OutlineLauncher.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
FC0799F92037545D00A1C822 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC0799F82037545D00A1C822 /* ServiceManagement.framework */; };
FC0FFD701FCDBE4E00EB0129 /* Shadowsocks_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCAFD3131FBA52690057EE7F /* Shadowsocks_macOS.framework */; };
FC1F250F2049B0DB0012D758 /* OutlineConnectionStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C2B520223164005FD743 /* OutlineConnectionStore.swift */; };
FC1F25122049B1470012D758 /* OutlineConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C282201A93D0005FD743 /* OutlineConnection.swift */; };
FC1F250F2049B0DB0012D758 /* OutlineTunnelStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C2B520223164005FD743 /* OutlineTunnelStore.swift */; };
FC1F25122049B1470012D758 /* OutlineTunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C282201A93D0005FD743 /* OutlineTunnel.swift */; };
FC1F25132049B2E40012D758 /* CocoaLumberjack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C30E41FA7C0E9004262BE /* CocoaLumberjack.framework */; };
FC1F25142049B2E40012D758 /* CocoaLumberjack.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C30E41FA7C0E9004262BE /* CocoaLumberjack.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
FC1F25152049B2E40012D758 /* CocoaLumberjackSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C30E51FA7C0E9004262BE /* CocoaLumberjackSwift.framework */; };
FC1F25162049B2E40012D758 /* CocoaLumberjackSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C30E51FA7C0E9004262BE /* CocoaLumberjackSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
FC1FCADC216D290100F078A5 /* Subnet.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC1FCADA216D289F00F078A5 /* Subnet.swift */; };
FC28C281201A93BF005FD743 /* OutlineVpn.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C280201A93BF005FD743 /* OutlineVpn.swift */; };
FC28C283201A93D0005FD743 /* OutlineConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C282201A93D0005FD743 /* OutlineConnection.swift */; };
FC28C284201A93D6005FD743 /* OutlineConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C282201A93D0005FD743 /* OutlineConnection.swift */; };
FC28C2B720223167005FD743 /* OutlineConnectionStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C2B520223164005FD743 /* OutlineConnectionStore.swift */; };
FC28C283201A93D0005FD743 /* OutlineTunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C282201A93D0005FD743 /* OutlineTunnel.swift */; };
FC28C284201A93D6005FD743 /* OutlineTunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C282201A93D0005FD743 /* OutlineTunnel.swift */; };
FC28C2B720223167005FD743 /* OutlineTunnelStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC28C2B520223164005FD743 /* OutlineTunnelStore.swift */; };
FC5FF90D1F3E1CEE0032A745 /* PacketProcessor_macOS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3679D25B96374CD5BE52C04F /* PacketProcessor_macOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
FC5FF90F1F3E1CEE0032A745 /* CocoaAsyncSocket.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 65F10DB2408748869386705A /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
FC5FF93A1F3E1E5F0032A745 /* VpnExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = FC5FF92B1F3E1E5F0032A745 /* VpnExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -179,8 +179,8 @@
FC0799F82037545D00A1C822 /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
FC1FCADA216D289F00F078A5 /* Subnet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Subnet.swift; path = Outline/Resources/vpn/Subnet.swift; sourceTree = SOURCE_ROOT; };
FC28C280201A93BF005FD743 /* OutlineVpn.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineVpn.swift; path = "cordova-plugin-outline/OutlineVpn.swift"; sourceTree = "<group>"; };
FC28C282201A93D0005FD743 /* OutlineConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineConnection.swift; path = "cordova-plugin-outline/OutlineConnection.swift"; sourceTree = "<group>"; };
FC28C2B520223164005FD743 /* OutlineConnectionStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineConnectionStore.swift; path = Outline/Resources/vpn/OutlineConnectionStore.swift; sourceTree = SOURCE_ROOT; };
FC28C282201A93D0005FD743 /* OutlineTunnel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineTunnel.swift; path = "cordova-plugin-outline/OutlineTunnel.swift"; sourceTree = "<group>"; };
FC28C2B520223164005FD743 /* OutlineTunnelStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OutlineTunnelStore.swift; path = Outline/Resources/vpn/OutlineTunnelStore.swift; sourceTree = SOURCE_ROOT; };
FC55AB411F4F960A0056F12C /* VpnExtension-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "VpnExtension-Info.plist"; path = "Outline/VpnExtension-Info.plist"; sourceTree = SOURCE_ROOT; };
FC5FF9121F3E1D1B0032A745 /* Outline.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Outline.entitlements; sourceTree = "<group>"; };
FC5FF92B1F3E1E5F0032A745 /* VpnExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = VpnExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -248,7 +248,7 @@
7069FBC31905A1F9000B48E1 /* Plugins */ = {
isa = PBXGroup;
children = (
FC28C282201A93D0005FD743 /* OutlineConnection.swift */,
FC28C282201A93D0005FD743 /* OutlineTunnel.swift */,
FC28C280201A93BF005FD743 /* OutlineVpn.swift */,
AA09EA80E0C54DFFB24A1810 /* OutlinePlugin.swift */,
FC8C30FB1FA7DDCB004262BE /* OutlineSentryLogger.swift */,
Expand Down Expand Up @@ -390,7 +390,7 @@
children = (
FCABE26421AF5CF1009B7C93 /* ShadowsocksConnectivity.h */,
FCABE26321AF5CF1009B7C93 /* ShadowsocksConnectivity.m */,
FC28C2B520223164005FD743 /* OutlineConnectionStore.swift */,
FC28C2B520223164005FD743 /* OutlineTunnelStore.swift */,
FC5FF9491F3E1EF00032A745 /* PacketTunnelProvider.h */,
FC5FF94A1F3E1EF00032A745 /* PacketTunnelProvider.m */,
FC5FF94B1F3E1EF00032A745 /* Shadowsocks.h */,
Expand Down Expand Up @@ -613,7 +613,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FC28C283201A93D0005FD743 /* OutlineConnection.swift in Sources */,
FC28C283201A93D0005FD743 /* OutlineTunnel.swift in Sources */,
FC8C30FC1FA7DDCB004262BE /* OutlineSentryLogger.swift in Sources */,
70BD683318FFB02D00A1EFCF /* main.m in Sources */,
70BD686D18FFB0BF00A1EFCF /* AppDelegate.m in Sources */,
Expand All @@ -632,8 +632,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FC1F25122049B1470012D758 /* OutlineConnection.swift in Sources */,
FC1F250F2049B0DB0012D758 /* OutlineConnectionStore.swift in Sources */,
FC1F25122049B1470012D758 /* OutlineTunnel.swift in Sources */,
FC1F250F2049B0DB0012D758 /* OutlineTunnelStore.swift in Sources */,
FC0799E92037532A00A1C822 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -642,11 +642,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FC28C284201A93D6005FD743 /* OutlineConnection.swift in Sources */,
FC28C284201A93D6005FD743 /* OutlineTunnel.swift in Sources */,
FC5FF94E1F3E1EF00032A745 /* PacketTunnelProvider.m in Sources */,
FCABE26521AF5CF1009B7C93 /* ShadowsocksConnectivity.m in Sources */,
FC1FCADC216D290100F078A5 /* Subnet.swift in Sources */,
FC28C2B720223167005FD743 /* OutlineConnectionStore.swift in Sources */,
FC28C2B720223167005FD743 /* OutlineTunnelStore.swift in Sources */,
FC5FF94F1F3E1EF00032A745 /* Shadowsocks.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
2 changes: 1 addition & 1 deletion apple/xcode/osx/Outline/Classes/AppDelegate.m
Expand Up @@ -95,7 +95,7 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
}];

if ([self wasStartedByLauncherApp]) {
[OutlineVpn.shared startLastSuccessfulConnection:^(enum ErrorCode errorCode) {
[OutlineVpn.shared startLastSuccessfulTunnel:^(enum ErrorCode errorCode) {
if (errorCode != ErrorCodeNoError) {
NSLog(@"Failed to auto-connect the VPN on startup.");
}
Expand Down
4 changes: 2 additions & 2 deletions apple/xcode/osx/OutlineLauncher/AppDelegate.swift
Expand Up @@ -23,8 +23,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
defer {
NSApp.terminate(self)
}
let connectionStore = OutlineConnectionStore(appGroup: AppDelegate.kAppGroup)
if connectionStore.status != OutlineConnection.ConnectionStatus.connected {
let tunnelStore = OutlineTunnelStore(appGroup: AppDelegate.kAppGroup)
if tunnelStore.status != OutlineTunnel.TunnelStatus.connected {
return NSLog("Not launching, Outline not connected at shutdown")
}
// Retrieve the main app's bundle ID programmatically from the embedded launcher bundle ID.
Expand Down
24 changes: 12 additions & 12 deletions cordova-plugin-outline/README.md
Expand Up @@ -44,17 +44,17 @@ We use a custom framework dependency, PacketProcessor, that implements tun2socks
This plugin supports Android, iOS, and macOS.

### Android
This plugin targets Android devices running Lollipop (API 21), or higher.
This plugin targets Android devices running Lollipop (API 22), or higher.

### Apple
This plugin targets Apple devices running iOS 9.0+ and macOS/OS X 10.11.
This plugin targets Apple devices running iOS 11.0+ and macOS/OS X 10.11.

## JavaScript API

```ts

// Represents a Shadowsocks server configuration.
interface ShadowsocksServerConfig {
interface ServerConfig {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to change this name as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this interface was always ServerConfig. The documentation was not in sync.

method?: string;
password?: string;
host?: string;
Expand All @@ -74,32 +74,32 @@ declare namespace cordova.plugins.outline {
send(uuid: string): Promise<void>;
}

// Represents a VPN connection to a proxy through the plugin.
export class Connection {
// Represents a VPN tunnel to a proxy through the plugin.
export class Tunnel {

// Creates a new instance with |serverConfig|.
// A sequential ID will be generated if |id| is absent.
constructor(serverConfig: ShadowsocksServerConfig, id?: string);

// Starts the VPN service, and tunnels all the traffic to a local Shadowsocks
// server as dictated by its configuration. If there is another running
// instance, broadcasts a disconnect event and stops the running connection.
// In such case, restarts tunneling while preserving the VPN connection.
// instance, broadcasts a disconnect event and stops the active tunnel.
// In such case, the VPN is not torn down.
start(): Promise<void>;


// Stops the connection and VPN service.
// Stops the tunnel and VPN service.
stop(): Promise<void>;

// Returns whether the connection instance is active.
// Returns whether the tunnel instance is active.
isRunning(): Promise<boolean>;

// Returns whether the connection is reachable by attempting to establish
// Returns whether the proxy server is reachable by attempting to establish
// a socket to the IP and port specified in |config|.
isReachable(): Promise<boolean>;

// Sets a listener, to be called when the VPN connection status changes.
onStatusChange(listener: (status: ConnectionStatus) => void): void;
// Sets a listener, to be called when the VPN tunnel status changes.
onStatusChange(listener: (status: TunnelStatus) => void): void;
}
}

Expand Down