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

Connection refused #17

Open
NHQ opened this issue Oct 5, 2011 · 7 comments
Open

Connection refused #17

NHQ opened this issue Oct 5, 2011 · 7 comments

Comments

@NHQ
Copy link

NHQ commented Oct 5, 2011

Hiya,

I tried throwing this in a quick app, but am getting connection refused and I can't figure out why. I read thru the module. I guess twitter is refusing the connection?

Error: ECONNREFUSED, Connection refused
    at Client._onConnect (net.js:601:18)
    at IOWatcher.onWritable [as callback] (net.js:186:12)

I've tried variously tracking and following. I also tried using the NPM version and a repo-cloned version, which I noticed had some big differences, one of them being http vs https. Niether worked, both returned the same error above. I also tried running the module on its own, not wrapped in an express app, as below. The app, mostly from your example:

var express = require('express');

var TwitterNode = require('twitter-node').TwitterNode
  , sys         = require('sys');

var app = module.exports = express.createServer();


var twit = new TwitterNode({
  user: 'astromanies', 
  password: '###',
  host: '74....',  
  port: 8000,                          
  track: ['baseball', 'football'],    
});

twit.addListener('error', function(error) {
  console.log(error.message);
});

twit
  .addListener('tweet', function(tweet) {
    sys.puts("@" + tweet.user.screen_name + ": " + tweet.text);
  })

  .addListener('limit', function(limit) {
    sys.puts("LIMIT: " + sys.inspect(limit));
  })

  .addListener('delete', function(del) {
    sys.puts("DELETE: " + sys.inspect(del));
  })

  .addListener('end', function(resp) {
    sys.puts("wave goodbye... " + resp.statusCode);
  })
  .stream();

// Configuration

app.configure(function(){
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(__dirname + '/public'));
});

app.configure('development', function(){
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); 
});

app.configure('production', function(){
  app.use(express.errorHandler()); 
});

app.listen(8080);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
@dustin10
Copy link
Contributor

dustin10 commented Oct 5, 2011

Hi. I submitted the patch for connecting over https and it is working for me. The only difference is that I am using the default host and port.

@jorgeguberte
Copy link

The patch indeed fixed the issue but the npm package isn't patched yet, as of October 9th.

@anthonywebb
Copy link

Still not updated :(

@Tmeister
Copy link

Hi, i have the same problem.

@dustin10
Copy link
Contributor

You need to clone the repo instead of using npm. The npm package does not contain the https fix.

@Tmeister
Copy link

Thanks @dustin10

FYI

If you need to use npm to deploy via package.json you can get the source from the last commit using something like this:

{
"name": "Your-app"
, "version": "0.0.1"
, "dependencies": {
"twitter-node": "https://github.com/technoweenie/twitter-node/tarball/ec4eb261891d78a88faabea54ea1016fd884b804"
}
}

Cheers..

@jorgeguberte
Copy link

@Tmeister Great!

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

5 participants