Proxy support #7

Open
hgavert opened this Issue Jun 4, 2012 · 8 comments

Comments

Projects
None yet
7 participants
@hgavert

hgavert commented Jun 4, 2012

Hi!

Twit is very cool indeed. However, I seem to have a problem in dev environment and I should use http(s) proxies. This doesn't connect and I think it's because the system proxies are not recognized by node.js. Any chance to add support for proxies (maybe optional params through conf)?

@ttezel

This comment has been minimized.

Show comment Hide comment
@ttezel

ttezel Jun 4, 2012

Owner

can you show me some code so I can get a better idea of what you're trying to do?

Owner

ttezel commented Jun 4, 2012

can you show me some code so I can get a better idea of what you're trying to do?

@hgavert

This comment has been minimized.

Show comment Hide comment
@hgavert

hgavert Jun 5, 2012

Hi!

I'm really just running your example stream code. This works when I'm at home (no proxies), but when I'm at the office I'm forced to use http/https proxies. So, the stream just seems to sit there, no tweets (I'm not actually tracking "mango") coming out. No errors either. Any ideas where to look? Obviously I'm not 100% sure it's the lack of proxies, but I'm guessing so.

var Twit = require('twit');
var T = new Twit({
consumer_key: 'my_key'
, consumer_secret: 'my_secret'
, access_token: 'my_token'
, access_token_secret: 'my_token_secret'
});
//
// filter the twitter public stream by the word 'mango'.
//
var stream = T.stream('statuses/filter', { track: 'mango' })
stream.on('tweet', function (tweet) {
console.log(JSON.stringify(tweet)); //.text
});

hgavert commented Jun 5, 2012

Hi!

I'm really just running your example stream code. This works when I'm at home (no proxies), but when I'm at the office I'm forced to use http/https proxies. So, the stream just seems to sit there, no tweets (I'm not actually tracking "mango") coming out. No errors either. Any ideas where to look? Obviously I'm not 100% sure it's the lack of proxies, but I'm guessing so.

var Twit = require('twit');
var T = new Twit({
consumer_key: 'my_key'
, consumer_secret: 'my_secret'
, access_token: 'my_token'
, access_token_secret: 'my_token_secret'
});
//
// filter the twitter public stream by the word 'mango'.
//
var stream = T.stream('statuses/filter', { track: 'mango' })
stream.on('tweet', function (tweet) {
console.log(JSON.stringify(tweet)); //.text
});

@kai-koch

This comment has been minimized.

Show comment Hide comment
@kai-koch

kai-koch Dec 7, 2012

This is not yet ported to the oauth module, due to missing unit-tests and other stuff:
ciaranj/node-oauth#108

I guess, when that is resolved one way or the other, it will make to twit then. :-)

kai-koch commented Dec 7, 2012

This is not yet ported to the oauth module, due to missing unit-tests and other stuff:
ciaranj/node-oauth#108

I guess, when that is resolved one way or the other, it will make to twit then. :-)

@webmutation

This comment has been minimized.

Show comment Hide comment
@webmutation

webmutation Oct 16, 2014

This still does not work a simple example like that behind a proxy returns

Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect as oncomplete

twit does not work behind a proxy?

This still does not work a simple example like that behind a proxy returns

Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect as oncomplete

twit does not work behind a proxy?

@vickykatoch

This comment has been minimized.

Show comment Hide comment
@vickykatoch

vickykatoch Nov 4, 2014

Is there any solution to this issue?

Is there any solution to this issue?

@ttezel

This comment has been minimized.

Show comment Hide comment
@ttezel

ttezel Jan 31, 2016

Owner

Would it work for your use cases if I provided the proxy and tunnel options that request allows you to set? I can let you set those variables. See here: https://github.com/request/request#proxies

Owner

ttezel commented Jan 31, 2016

Would it work for your use cases if I provided the proxy and tunnel options that request allows you to set? I can let you set those variables. See here: https://github.com/request/request#proxies

@pppurple

This comment has been minimized.

Show comment Hide comment
@pppurple

pppurple Feb 16, 2016

request module following environment variables.

export HTTP_PROXY=http://proxyhost:port
export HTTPS_PROXY=https://proxyhost:port

request module following environment variables.

export HTTP_PROXY=http://proxyhost:port
export HTTPS_PROXY=https://proxyhost:port

@Volox Volox referenced this issue in totemstech/instagram-node Mar 2, 2016

Open

Proxy #67

@jesuiscamille

This comment has been minimized.

Show comment Hide comment
@jesuiscamille

jesuiscamille Jun 14, 2016

You can use proxychains instead.

You can use proxychains instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment