I would like to know if it is possible for me to, in nodejs, connect to a proxy with the ip and port, execute some code with the proxies ip and not my local one, and then disconnect. An example (completely nonexistent just for helping explain better):
function codeToExecute() {
logIP(); //non-existent function to log the current ip, should log the proxies ip and not mine
//more code here to be executed under the proxie's ip
}
var connectProxy = require('someproxyscript');
connectProxy.setProxy('192.781.892.32','8080').execute(codeToExecute();)
connectProxy.disconnect();
This is not asking how to get html headers or anything like that, and I would not prefer to use NodeJS http lib, I want to be able to execute a section of my code under a different ip address then what mine is, then disconnect and go back to my own ip address. Basically, I want to proxy a line of code.