Nodejs Proxy coming out with connection from another computer

1

I have a script in NodeJS that connects to an HTTPS API, but the server where the script is located is behind a proxy that does not allow HTTPS output. My query is: How can I make a script so that it uses the internet output of another computer than its proxy if it allows HTTPS connection. I want to say that this same script, if it works on a server with internet access and connects to the HTTPS API. Then, from the server that does not have HTTPS output, I want to use the server's internet that allows HTTPS output, which both servers are within the LAN network.

Greetings.

    
asked by elrodrix 23.12.2016 в 14:02
source

1 answer

1

If an HTTP proxy is configured on the computer that has permissions for HTTPS connections, it is relatively easy to connect through that computer:

var http = require('http');

http.get ({
    host: '192.168.1.100', //IP del equipo donde configuraste el proxy
    port: 8080,
    path: 'https://www.url.com/de/API'
}, function (rta) {
    // Procesar la respuesta
    console.log (rta);
});
    
answered by 30.12.2016 / 15:15
source