Connect to GitHub REST API behind proxy


So, I’m building a software and I want to implement a update notifier through the github api like this,

$(document).ready (function () {
    $.getJSON("").done(function (data) {
        var new_ver =data[0].name
            alert(`New version ${new_ver} available.`)

This works fine for direct network connection with no proxy. But how do I implement this if I had to use a proxy, port with user authentication to connect to the internet, as this method can’t connect to the api.