LogoLogo
  • Platform Overview
  • 🗺️Guides
    • Getting Started
    • Users
      • Integrate the User SDK
      • Registration
      • Authentication
      • SDK Releases
      • API Reference
    • Entitlements
      • Administrative API
        • Integrating the Administrative API
        • Entitlement Definitions
        • Managing Entitlements Sets
        • Managing Entitlements Sequences
        • Managing User Entitlements
        • API Schema
      • End-user API
        • Integrate the Entitlements SDK
        • Redeeming Entitlements
        • Retrieving Entitlements
        • SDK Releases
        • API Reference
    • Sudos
      • Integrate the Sudo Profiles SDK
      • Sudo Entitlements
      • Manage Sudos
      • SDK Releases
      • API Reference
    • Telephony
      • Integrate the Telephony SDK
      • Manage Phone Numbers
      • Text Messaging
      • Voice Calling
      • Telephony Simulator
      • SDK Releases
      • API Reference
    • Email
      • Integrate the Email SDK
      • Email Entitlements
      • Manage Email Addresses
      • Sending & Receiving Email
      • Manage Email Folders
      • Draft Email Messages
      • Manage Email Address Blocklists
      • Email Address Public Information
      • Pagination
      • Caching
      • Configuration Data
      • Email Notifications
      • SDK Releases
      • API Reference
    • Decentralized Identity
      • Edge Agent
        • Relay SDK
          • Integrate the Relay SDK
          • Relay Entitlements
          • Manage Relay Postboxes
          • Manage Relay Messages
          • Receiving Messages
          • SDK Releases
        • Edge Agent SDK
          • Integrate the Edge Agent SDK
          • Agent Management
          • Manage Wallets
          • Establishing Connections
          • Manage Connections
          • Messaging
          • Manage DIDs
          • Accepting New Credentials
          • Manage Credentials
          • Present Credentials for Verification
          • Utilize Alternative Cryptography Providers
          • SDK Releases
          • Standards and Protocols
      • Cloud Agent
        • Cloud Agent Admin API
          • Integrate the Cloud Agent Admin API
          • Aries Interop Profile (AIP)
            • Connection Exchanges
            • Credential Exchanges
            • Proof Exchanges
          • Connections
          • Basic Messages
          • Credentials
            • Anoncreds Credentials
              • Schemas
              • Credential Definitions
            • W3C Credentials
          • Audit Logs
          • API Schema
          • Error Codes
          • Standards and Protocols
    • Virtual Cards
      • Integrate the Virtual Cards SDK
      • Virtual Cards Entitlements
      • Virtual Cards Transaction Velocity Constraints
      • Key Management
      • Manage Funding Sources
      • Manage Virtual Cards
      • Manage Transactions
      • Configuration Data
      • Pagination
      • Caching
      • SDK Releases
      • API Reference
    • Virtual Cards Simulator
      • Integrate the Virtual Cards Simulator SDK
      • Simulate Authorizations
      • Simulate Debits
      • Simulate Refunds
      • Simulate Reversals
      • Merchants and Currencies
      • SDK Releases
      • API Reference
    • Virtual Private Network
      • Integrate the VPN SDK
      • VPN Entitlements
      • Manage Servers
      • Manage Connection
      • Observe VPN Related Events
      • SDK Releases
      • API Reference
      • Frequently Asked Questions
    • Secure ID Verification
      • Integrate the Secure ID Verification SDK
      • List Supported Countries
      • Verify an Identity
      • Check Secure ID Verification Status
      • Use the Secure ID Verification Simulator
      • SDK Releases
      • API Reference
    • Password Manager
      • Integrate the Password Manager SDK
      • Accessing the Password Manager
      • Managing Password Vaults
      • Managing Password Vault Items
      • Vault Import and Export
      • Password Utilities
      • Password Manager Entitlements
      • Password Vault Security
      • SDK Releases
      • API Reference
    • Ad/Tracker Blocker
      • Integrate the Ad/Tracker Blocker SDK
      • Manage Rulesets
      • Blocking Ads and Trackers
      • Manage Exceptions
      • SDK Releases
      • API Reference
    • Site Reputation
      • Integrate the Site Reputation SDK
      • Use the Site Reputation SDK
      • SDK Releases
      • API Reference
  • 💡Concepts
    • Sudo Digital Identities
  • 🧱Development
    • Versioning
  • 🏢Administration
    • Admin Console Roles
  • ❓Get Help
    • Request a Demo
    • Report an Issue
Powered by GitBook
On this page
  1. Guides
  2. Virtual Private Network

Manage Servers

Provides your users with the ability to list servers used to establish a connection.

The VPN SDK provides a set of APIs to allow your users to manage the servers they choose to use to establish a VPN connection.

The SudoVPNServer object contains information about the server.

Property
Description

country

The ISO 3166-1 Alpha-2 code of the country location.

region

The region within the server country location (e.g. Florida).

coordinates

Longitude and latitude coordinates of the server location.

load

Server utilization which ranges from 0-100. 0 is low, whereas 100 is high.

ipAddress

IP Address of the server.

Retrieving Servers

In order to establish a connection using the VPN SDK, a server is required. A list of available servers can be retrieved using the list servers API.

There are two options for retrieving the list of servers.

The user must be entitled in order to use the method listServers(cachePolicy:). This method updates an internal cache which is required in order for a connection to complete, so there may be efficiency gains to using this method once the user has been confirmed to be entitled.

Note that it is not mandatory for clients to call this method explicitly, however it will be called internally upon connection, if its internal cache has not already been populated.

Unentitled users must use the paginated method

  listServers(
      countriesFilter: [],
      limit:,
      nextToken:,
      cachePolicy:)

to retrieve a list of servers, which can be filtered by an array of ISO3166 Alpha-2 two letter country codes. The limit and nextToken parameters are used to paginate through a potentially large list. This method uses an independent cache.

Each method will either return a list of valid servers to connect to, or an empty list if none are available. In the event of an error, a SudoVPNError will be thrown.

An example for unentitled users is:

var allServers: [SudoVPNServer] = []
do {
    var serverResult = 
        try await vpnClient.listServers(
            countriesFilter: ["AU"], 
            limit: 2000, 
            nextToken: nil)
    allServers.append(contentsOf: serverResult.items)
    // If you wish to handle all retrievals in a single task context
    while serverResult.nextToken != nil {
      serverResult = 
          try await vpnClient.listServers(
              countriesFilter:["AU"],
              limit: 2000,
              nextToken: serverResult.nextToken)
} catch {
    // Handle errors
}

And for entitled users:

var allServers: [SudoVPNServer] = []
do {
    allServers = 
        try await vpnClient.listServers(cachePolicy: .remoteOnly)
} catch {
    // Handle errors
}

A call to the listServers method provides a list of servers that can be used to establish a connection. An example implementation of retrieving the available servers is:

launch {
    try {
        val servers = withContext(Dispatchers.IO) {
            vpnClient.listServers()
        }
        // If no exception is thrown then the list of [servers] is returned.
    } catch (e: SudoVPNException) {
        // Handle/notify user of exception
    }
 }

The call to listServers will return the list of available servers. If an exception occurs, the e.localizedMessage can be presented to the user to notify them as to what caused the exception.

PreviousVPN EntitlementsNextManage Connection

Last updated 1 year ago

🗺️