3

I would liek to run Tor on my Mac (El Capitan), such that another program (a Ruby script) can make HTTP requests through my running Tor process. I installed via "sudo port install tor" and then launched tor like so

tor --CookieAuthentication 0 --HashedControlPassword "" --ControlPort 9050 --SocksPort 50001

But I'm confused about the difference between "ControlPort" and "SocksPort". In my script, shoudl I be connecting to "127.0.0.1:9050" or "127.0.0.1:50001"?

Thanks, -

2

The control port is used for controlling Tor, usually via other software like Arm.

The Socks port is the port running as a SOCKS5 proxy. This is the one you want to use. Please note that Tor is not an HTTP proxy, so your script will need to be configured to use a SOCKS5 proxy.

  • So if I were connecting on Telnet, would I connect via "127.0.0.1:50001"? – Dave Sep 17 '16 at 17:00
0

SocksPort is for accepting SOCKS connections from tor clients(=applications that will be "torified"), ControlPort is for communicating with tor controllers, i.e. applications that are interacting and possibly modifying tor's configuration(like "running config" on Cisco)

0

The SOCKSPort is for talking to other applications. Tor runs as a SOCKS proxy and other applications (like a web browser, another proxy etc.) could connect to it. The manpage writes:

SOCKSPort [address:]port|unix:path|auto [flags] [isolation flags]

Open this port to listen for connections from SOCKS-speaking applications.

The ControlPort is for connecting with the Tor process and sending it commands. You can use the ControlPort for changing the configuration, getting information about the network, Tor circuits etc. The manpage writes:

ControlPort PORT|unix:path|auto [flags]

If set, Tor will accept connections on this port and allow those connections to control the Tor process using the Tor Control Protocol (described in control-spec.txt).

So your Ruby software should talk to port 50001, the SOCKSPort. However you wrote about HTTP requests. Please make sure that your Ruby software will issue SOCKS requests or you might run into other problems. Depending on the kind of requests it might be a good idea to use some other HTTP proxy (like Privoxy) between your Ruby software and Tor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.