Setup
Installation of the service, basic methods and examples of their use.
Getting Started
Sign in at pango-cloud.com.
Create a project and use a name for your project as a Public key. Private key is optional.
Use SDK where
carrierId
equals given Public Key and backend url equals default SDK url or url provided by Pango team.
Note that at this time, it is not possible for users to create their own accounts directly if they do not already have an account established with us. Please contact your sales representative to initiate account creation as part of the project and client onboarding process or contact us. We apologize for any inconvenience.
Install
UnifiedSDK service
. Run the command from the directory where SDK service executable is located:
where:
-i "ServiceName"
- command to register UnifiedSDK service in the system with the nameServiceName
.-d "c:\ProgramData\MyApp"
- configure path to the data folder.-c "CommandPipeName"
- command pipe name.-e "EventPipeName"
- event pipe name.
We recommend to specify -d
, -c
and -e
options to avoid possible conflicts with other applications using the same pipe names or folders.
You don't need to remove existed service before installation. UnifiedSDK service will remove existed itself.
Additional information about command line argumets can be found there:
Service command line argumentsDuring this call:
Service executable file will be registered as windows service with specified name (
ServiceName
).Service will create the configuration file into the specified
-d
folder"c:\ProgramData\MyApp"
.
If you use a self-contained UnifiedSDK service then you don't need to install a runtime.
Otherwise you need to install .NET 8.0 Desktop Runtime.
Add
UnifiedSDK.Core.dll
/UnifiedSDK.Core.net48.dll
to your project.Create UnifiedSDK.Core.SDK class instance with parameters: - Command pipe name. - Event pipe name. - Command pipe message format (XML or JSON). - [Optional] Microsoft.Extensions.Logging.ILogger<SDK> instance.
C#
C++
Initialize the SDK by sending an initialization request to the UnifiedSdkService with the required parameters: - Backend URI: The URL of the backend API. - Netfilter driver name: The name of the netfilter driver. - AppVersion: The version of your application. This value should contains four hierarchical numeric components: major, minor, build and revision. - [Optional] Reserve URIs: Optional reserve backend server URIs. By default: null. - [Optional] MessageFormat: The format of the event messages from UnifiedSdkService (XML or JSON). By default:
MessageFormat.JSON
. - [Optional] Required events from UnifiedSdk service that will be sent by the event pipe. By default:ServiceEvents.Default (StateChanged | ErrorOccurred | TrafficChanged | ProcessExited)
. Note, that hydra protocol has some additional event. If you wan't to receive all possible events, then you can useServiceEvents.HydraEvents (StateChanged | ErrorOccurred | TrafficChanged | ProcessExited | HydraProcessExiting | HydraUnsafeBlockedResource | HydraFireshieldDomainBlocked | HydraSocketCreated | HydraSocketClosed)
or you can specify your own list of events.
C#
C++
An example response looks as follows:
Make sure to call the Initialize/InitializeAsync
methods before using any other SDK methods.
SDK has hardcoded PROD reserve addresses by default. You need to use empty collection of reserve addresses when you want to avoid this behavior.
More details about backend addresses configuration can be found there:
Backend URL ConfigurationAuthentication
Pango Partner VPN Backend supports OAuth authentication with a partner's OAuth server as the primary authentication method.
Steps to Implement OAuth
Deploy and configure the OAuth service. Ensure that the service is publicly available on the Internet.
Configure the Partner Backend to use the OAuth service.
Implement client OAuth for your application.
Retrieve the access token in the client app. This token will be used to initialize and sign in.
Authentication method types
AuthenticationMethod.Anonymous;
AuthenticationMethod.OAuth
AuthenticationMethod.Firebase
Custom Authentication
Login Implementation Example
The last parameter (token) can be null only when using the Anonymous authentication method.
An example response looks as follows:
Custom Authentication
Custom Authentication allows you to integrate your existing authentication system with our cloud platform. Instead of using a predefined authentication method such as google
, facebook
, or oauth
, you can pass a custom string identifier to indicate your preferred authentication mechanism.
To implement Custom Authentication:
Replace the authentication method enum value with a string that uniquely identifies your authentication system, such as your company name or a specific identifier.
Obtain a token (
TOKEN
) from your authentication system.Pass this custom string and the token received from your authentication system as parameters to the
LoginAsync
method.
Our team will work closely with you to customize the authentication method to meet your specific requirements. This will involve technical meetings and exchanging documentation to ensure a seamless integration with your existing authentication system.
Example login implementation using Custom Authentication:
Updating the SDK
Follow these steps to update the Unified SDK:
(Optional) Stop the current SDK service.
Download the latest version of the Unified SDK.
Contact your account manager to obtain the download link for the latest Windows SDK.
Reinstall the SDK service by running the following command:
You don't need to remove existed service before installation. UnifiedSDK service will remove existed itself.
(Optional) Start the Unified SDK service.
Always reinstall the SDK service if you modify any installation parameters to ensure the changes take effect.
Uninstalling the SDK
To uninstall the SDK, run the following command:
App is responsible to install and remove the NetFilter driver on app install/uninstall.
SDK is responsible to start and stop NetFilter driver on SDK service Init and service stop.
Last updated