Unified in-app VPN SDK's for Microsoft Windows Vista+, Android 4.4+, Mac OS 10.7+, iOS 9.0+, Ubuntu Linux LTS 18.04+. 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(bool premium)
{
    json_object *j_obj, *j_data_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));
    j_data_obj = json_object_new_object();
    json_object_object_add(j_data_obj, "premium", json_object_new_boolean(premium));
    json_object_object_add(j_obj, "data", j_data_obj);
    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:

[ 
    { 
        "ip": "192.111.132.43", 
        "name": "Canada Vancouver", 
        "hostname": "canada-vancouver.keenvpn.me", 
        "country": "CA", 
        "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" 
        ], 
        "lz4": true, 
        "lz4_ports": [ 
            "1149", 
            "4600", 
            "5500" 
        ], 
        "xor": true, 
        "xor_ports": [ 
            "443", 
            "80", 
            "1499", 
            "9919", 
            "8332", 
            "30303", 
            "18080", 
            "8081", 
            "3333" 
        ], 
        "smart_dns_id": "14", 
        "flag": "https:\/\/client-api.keenow.com\/serverlist\/flags\/new_res\/ca.png", 
        "protocols": { 
            "l2tp": true, 
            "openvpn": true, 
            "ikev2": true 
        }, 
        "lat": "49.2366", 
        "lon": "-122.8521", 
        "distance": 10251.369694275
    }
]