Fetching a list of available locations
Locations represent a cluster of servers at a specific geographical location. The SDK will use proper caching so that this list is frequently updated.
get_locations_for_protocols
get_locations_for_protocols Fetch list of locations with an HTTP call or from local HTTP cache, small response payload size. This will return all available locations for the provided subscription id and protocols. A shortcut to this method is get_locations() which will set the protocols to lightway, openvpn and wireguard.
Parameters
subscription_id
ID of the subscription which has a VPN entitlement. You can obtain that subscription id as described in Obtaining a VPN Subscription ID
protocols
An array of protocol identifiers.
lightway
openvpn
wireguard
proxy
Returns
Array of ServerLocation objects if successful, InstanceDiscoveryException otherwise.
get_full_locations_for_protocols
get_full_locations_for_protocolsFetch full dataset of all locations and endpoints, around 3MB JSON payload compressed to around 300kb over the wire, or read from local cache. The method returns all available locations for the provided subscription id and protocols.
The set of protocols must be full list of protocols supported by current client.
Parameters
subscription_id
ID of the subscription which has a VPN entitlement. You can obtain that subscription id as described in Obtaining a VPN Subscription ID
protocols
An array of all protocol identifiers supported by current client.
lightway
openvpn
wireguard
proxy
ServerLocation
id
Unique ID of that location
name
Display Name of that location
latitude
Geographical Latitude of that location
longitude
Geographical Longitude of that location
country_code
instance_count_min
Minimum number of instances in that location
instance_count_max
Maximum number of instances in that location
is_geolocated
If true, this instance is physically not located in that location, but emulates the location by using a specific set of IPs, which are associated with that location
popularity_order
If set, it defines the popularity of that location, which can be used to show popular locations in the UI of the app
test_ips
A set of IPs, which this instance provided to run speedtests
Last updated