node-tweet-cli icon indicating copy to clipboard operation
node-tweet-cli copied to clipboard

Unable to authenticate behind proxy

Open nevalsar opened this issue 10 years ago • 4 comments

I installed via NPM and on using tweet login I'm faced with this:

> tweet login
info:    Start sending request to https://twitter.com
error:   Error while executing command!

I'm using zsh on a Linux system behind an http proxy server with environment variables http_proxy https_proxy set. Are proxies supported at the moment or does it require any particular environment variables to be set?

nevalsar avatar Oct 24 '14 11:10 nevalsar

@routeaccess there could be a trouble with Twitter API itself but not with the module.

voronianski avatar Oct 29 '14 10:10 voronianski

I also have this problem with CentOS and proxy.

You should use 'request' which supports better handling of environment vars in common/auth.js

There is a good example using Twitter on their README -> https://github.com/request/request

// OAuth1.0 - 3-legged server side flow (Twitter example)
// step 1
var qs = require('querystring')
  , oauth =
    { callback: 'http://mysite.com/callback/'
    , consumer_key: CONSUMER_KEY
    , consumer_secret: CONSUMER_SECRET
    }
  , url = 'https://api.twitter.com/oauth/request_token'
  ;
request.post({url:url, oauth:oauth}, function (e, r, body) {

aogilvie avatar Oct 23 '15 06:10 aogilvie

@aogilvie @nevinvalsaraj any workarounds?

voronianski avatar Jan 23 '16 19:01 voronianski

@voronianski I used a different cli twitter client in the end.

aogilvie avatar Jan 24 '16 00:01 aogilvie