alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
317 stars 98 forks source link

ECONNREFUSED #156

Closed jeffed closed 10 years ago

jeffed commented 11 years ago

Hi. Totally new to this, and while I was able to get my both (actually a sample bot) entering the room once, all I get now is an ECONNRFUSED error.

Firewall is off. Any suggestions?

using the bop.js sample this is what i get..

events.js:71 throw arguments[1]; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:770:11) at Object.afterConnect as oncomplete

alaingilbert commented 11 years ago

What is the code exactly (without your credential) ? What is the complete stacktrace ?

Izzmo commented 11 years ago

What service are you using to connect to tt, or are you just running a local node instance on your home PC?

Sent from my Windows Phone


From: jeffedmailto:notifications@github.com Sent: ‎2/‎28/‎2013 12:44 PM To: alaingilbert/Turntable-APImailto:Turntable-API@noreply.github.com Subject: [Turntable-API] ECONNREFUSED (#156)

Hi. Totally new to this, and while I was able to get my both (actually a sample bot) entering the room once, all I get now is an ECONNRFUSED error.

Firewall is off. Any suggestions?

using the bop.js sample this is what i get..

events.js:71 throw arguments[1]; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:770:11) at Object.afterConnect as oncomplete


Reply to this email directly or view it on GitHub: https://github.com/alaingilbert/Turntable-API/issues/156

jeffed commented 11 years ago

Hi All, and thanks for the quick response using the example bop.js code as it was.

var Bot    = require('ttapi');
var AUTH   = 'xx';
var USERID = 'xx';
var ROOMID = 'xx';

var bot = new Bot(AUTH, USERID, ROOMID);
bot.debug = true;

bot.on('speak', function (data) {
  var text = data.text;

  // Any command with "bop" in it will work (ex: "bop","bop i beg you!!!","lolbopbaby", etc.)
  if (text.match(/bop/)) {
    bot.vote('up');
  }
});

I am not quite sure how to get a complete stack trace. Let me review some of the other postings and see if I can figure that out, or else a little pointer?

thanks,

jeffed commented 11 years ago

Does this help?

Error
    at Object.<anonymous> (/Users/jdarla/turnbots/Turntable-API-master/bop.js:15:13)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: connect ECONNREFUSED
    at errnoException (net.js:770:11)
    at Object.afterConnect [as oncomplete] (net.js:761:19)
alaingilbert commented 11 years ago

yes thanks ! But the error is strange. How did you install ttapi ? have you installed it with npm ? Like : npm install ttapi in the folder where your bop.js is ? I guess no ?!

What you should do is :

jeffed commented 11 years ago

worked like a charm! Thanks!

alaingilbert commented 11 years ago

You're welcome :)

Izzmo commented 11 years ago

Interesting fix...

jeffed commented 11 years ago

But wait...there's more...

Looks like the problem recurs when I am behind a corporate proxy server. If I am on the open web, it works just fine. Once I go into Proxy mode, the error comes back.

Still happy, but could be a little happier at work..

thanks for the help!

Izzmo commented 11 years ago

Alright, that sounds more correct. I knew just directly putting files/installing from npm wouldn't be the full reason for the problem.

With the proxy server in place, there could be some things happening there, such as the websocket connection not being supported, but nodejs trying to use it anyways and not going down to http long-polling or something to that degree.

I have operated bots on proxies and VPN's before without problem but the VPN/proxy server can be finicky at times.

jeffed commented 11 years ago

I really appreciate you patience and support in helping me work through this.

I guess I am at a loss on how to go from here. Tried to set up a webproxy through terminal to TT on port 80. or am i way off base here...totally out of my element.

Izzmo commented 11 years ago

I would just open up an account on a free service and try and get your bot working there.