talmobi/tor-request

always get error (SocksClientError: connect ECONNREFUSED 127.0.0.1:9050)

Opened this issue · 7 comments

after installing and running the module, I get an error from a function of one of the dependencies. (socksclient.js: 371: 32). Maybe it dependence(module"socksclient") did`t work correct now?

Can you see the full error log where it says:

(node:95146) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:9050


 - Are you running `tor`?
See easy guide here (OSX, Linux, Windows):
https://github.com/talmobi/tor-request#requirements

 Quickfixes:
  OSX: `brew install tor && tor`         # installs and runs tor
  Debian/Ubuntu: `apt-get install tor`   # should auto run as daemon after install
  Windows: download the Windows Expert Bundle from `https://www.torproject.org/download/tor/`
           Unzip and run tor.exe inside the Tor/ directory.

See the: https://github.com/talmobi/tor-request#requirements

see related issues: #3 #40 #54

Basically you have most likely forgot to run your tor client before using tor-request

I am getting the same error even when my tor is running:-

netstat -ano | find "9060"
  TCP    127.0.0.1:9060         0.0.0.0:0              LISTENING       7804
tasklist /fi "pid eq 7804"
Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
tor.exe                       7804 Console                    1     40,648 K

OS:- Windows 11

Here's the link to my torrc file:-
https://gist.github.com/DhananjayPurohit/40d377e67e5ac7bf5f0f3b86717fdd77

@DhananjayPurohit tor is usually running on port 9050 by default -- but your seems to be running on port 9060 -- try setting the port specifically to 9060 using

var tr = require('tor-request');
var ipaddress = "127.0.0.1"
var port = 9060
tr.setTorAddress(ipaddress, port); // "127.0.0.1" and 9050 by default

I ensured the port to be 9060 still getting the error, Is there any tool or process you can recommend for checking what's wrong with my SOCKS port?

@DhananjayPurohit maybe there is wrong with library configuring the port -- try running your tor on port 9050 instead by changing line 18 in your torrc and trying again.

you can check which ports are active/in use using:

lsof -i -P -n | grep LISTEN