Skip to content


Subversion checkout URL

You can clone with
Download ZIP


ECONNREFUSED when connecting locally #108

clintandrewhall opened this Issue · 2 comments

3 participants


I've enjoyed using request on a number of projects, but this problem has me stumped.

When attempting to use request to access a data-serving endpoint on my local machine on, say, port 3000, I get a ECONNREFUSED. Yet if I use a simple function using the http module, it processes normally.

Perhaps there is something wrong with my server code that would deny some header or agent set by this module, but I'm just not sure. I'm using Connect, which is pretty standard out of the box... any insight?


are you using listen(8000, function () { request('http://localhost:8000') })

that's probably what is happening, newer versions of node are really need you to wait for the listen callback to fire before connecting. closing until you respond.

@mikeal mikeal closed this

I get this same error, my node is running on 8081 and Im trying to POST to another service that is running on my local machine on 8080. I can post to external websites fine it seems. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.