totemstech/instagram-node

Proxy

Opened this issue · 5 comments

Is it possible to use proxy with you library?
I mean connect to instagram server through proxy server via HTTPS.

Volox commented

+1 I have the same problem. Also using the request lib makes it simple see ttezel/twit#7

Volox commented

Sorry @misterjt but i cannot figure out how to use an Agent to set a proxy. The only thing i found is node-https-proxy-agent.

@Volox it's right. Set up the node-https-proxy-agent object and pass it like

function getAPI(token){
    var temp_ip='127.0.0.1';
    var temp_proxy=temp_ip+':7459';
    var api= require('instagram-node').instagram({
        sign_request:{client_secret:clientSecret,ip:temp_ip},
        agent:new HttpsProxyAgent(temp_proxy)
    });
    api.use({access_token:token});
    return api;
}

this is real code from my project.

Volox commented

Ok, just like my implementation. Thanks @misterjt .