Shiny.addCustomMessageHandler("token", user);

function user(token) {
    var ipinfo_url = "https://ipinfo.io?token=" + token;
    var retval = $.get(ipinfo_url, function(response) {
        // console.log(response.ip, response.country, ipinfo_url);
        Shiny.onInputChange("user", response);
    }, "jsonp");
};
