Unified in-app VPN SDK's for Microsoft Windows Vista+, Android 4.4+ and Mac OS 10.7+. Earlier OS versions can be supported as well by request. Please contact [email protected] to receive your own API key.

Copyright © 2019 VPNWholesaler.com. All rights reserved.

Back

3.3 GetServlist_bygeo OS X Example

GetServerListbyGeo() function could be written in the following way:

void GetServerListbyGeo()
{
    json_object *j_obj;
    char szCmd[1024];
    j_obj = json_object_new_object();
    json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_GET_SERVLIST_BYGEO));
    snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
    json_object_put(j_obj);
    CmdProc(szCmd);
}

Result will be returned via callback as a JSON:

code will be OVS_NOTIFY_GET_SERVLIST_BYGEO

err will be OVS_ERR_OK in case of success

data will be an object of the following structure:

 {
    "45.32.158.20": {
      "name": "Germany (Frankfurt #2)",
      "country": "DE",
      "hostname": "germany-frankfurt-2.vpnsr.us",
      "cipher": [
        "BF-CBC",
        "AES-128-CBC",
        "AES-128-GCM",
        "AES-256-CBC",
        "AES-256-GCM"
      ],
      "cipher_tcp_ports": [
        "1194",
        "8080",
        "8181",
        "1299",
        "1199",
        "8989",
        "8289",
        "1399",
        "9989"
      ],
      "cipher_udp_ports": [
        "1194",
        "8080",
        "8181",
        "1299",
        "1199",
        "8989",
        "8289",
        "1399",
        "9989"
      ],
      "xor": true,
      "xor_ports": [
        "443",
        "80",
        "1499",
        "9919",
        "8332",
        "30303",
        "18080",
        "8081",
        "3333"
      ],
      "non_comp_port": [
        "1600",
        "2529"
      ],
      "smart_dns_id": "4",
      "flag": "https://client-api.keenow.com/serverlist/flags/new_res/de.png",
      "protocols": {
        "l2tp": true,
        "openvpn": true,
        "ikev2": true
      },
      "lat": "50.1137",
      "lon": "8.7119",
      "distance": 1.6875546449843
    }
  }