Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy #67

Open
misterjt opened this issue Sep 14, 2015 · 5 comments
Open

Proxy #67

misterjt opened this issue Sep 14, 2015 · 5 comments

Comments

@misterjt
Copy link

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

@Volox
Copy link

Volox commented Mar 2, 2016

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

@misterjt
Copy link
Author

misterjt commented Mar 2, 2016

@Volox https://nodejs.org/api/https.html#https_class_https_agent
And pass it as agent option in this lib.

@Volox
Copy link

Volox commented Mar 2, 2016

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.

@misterjt
Copy link
Author

misterjt commented Mar 2, 2016

@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
Copy link

Volox commented Mar 2, 2016

Ok, just like my implementation. Thanks @misterjt .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants