Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

263
Vistas
How to route API requests through certain IP address?

On a remote server, there is an HTML page with javascript. The user visits this page, makes some settings, and runs an API query.

How can I ensure that all API queries are routed independently from the user's location through a specific IP address, which is my proxy gateway? How is it possible with javascript?

This is the whole function that runs API query:

function Query(keyword)
{
    var qk = keyword;
    var queryresult = '';
    queryflag = true;


    $.ajax({
        url: window.location.protocol + "//apiv3.example.com/lookup",
        jsonp: "jsonp",
        dataType: "jsonp",
        data: {
        q: qk,
        client: "chrome",
        hl: document.querySelector("select").value
        },

        success: function(res) {
            var rL = res[1];

            var i = 0;
            for(i = 0; i < rL.length; i++)
            {
                var currents = CleanVal(rL[i]);
                if(hashMapResults[currents] != 1)
                {
                    hashMapResults[currents] = 1;
                    SaveLatest(CleanVal(rL[i]));

                    ktq[ktq.length] = currents;

                    var j = 0;
                    for(j = 0; j < 26; j++)
                    {
                        var chr = String.fromCharCode(97 + j);
                        var currentx = currents + ' ' + chr;
                        ktq[ktq.length] = currentx;
                        hashMapResults[currentx] = 1;
                    }
                }
            }
            FilterAndDisplay();
            var textarea = document.getElementById("input");
            textarea.scrollTop = textarea.scrollHeight;
            queryflag = false;
        }
    });
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can't control routing between the user and the endpoint.

If you want data to go through your server then the URL you pass to $.ajax needs to be that of your server.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda