How to config tor to use a HTTP/SOCKS proxy?

4

2

My ISP has blocked the tor network. I cannot connect to the directory server.
How can I config tor through a HTTP/SOCKS proxy to make the connection?

I'm using ubuntu server without GUI desktop envirement. I need to config tor through command line.

# /var/log/tor/log
...
Mar 14 14:34:27.556 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 42; recommendation warn)
Mar 14 14:36:29.540 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 43; recommendation warn)
Mar 14 14:42:35.556 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 44; recommendation warn)
Mar 14 14:53:46.532 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 45; recommendation warn)
Mar 14 15:34:26.596 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 46; recommendation warn)
Mar 14 15:34:57.572 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 47; recommendation warn)
Mar 14 15:36:28.580 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 48; recommendation warn)
Mar 14 15:42:34.532 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 49; recommendation warn)
Mar 14 15:53:45.572 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Connection timed out; TIMEOUT; count 50; recommendation warn)

kev

Posted 2013-03-14T08:27:17.360

Reputation: 9 972

Answers

17

You need to edit your torrc file, which is probably in /etc/tor/torrc. User-specific config is in ~/.torrc.

The relevant options for you are (taken from the man page):

HTTPProxy host[:port]

Tor will make all its directory requests through this host:port (or host:80 if port is not specified), rather than connecting directly to any directory servers.

HTTPProxyAuthenticator username:password

If defined, Tor will use this username:password for Basic HTTP proxy authentication, as in RFC 2617. This is currently the only form of HTTP proxy authentication that Tor supports; feel free to submit a patch if you want it to support others.

HTTPSProxy host[:port]

Tor will make all its OR (SSL) connections through this host:port (or host:443 if port is not specified), via HTTP CONNECT rather than connecting directly to servers. You may want to set FascistFirewall to restrict the set of ports you might try to connect to, if your HTTPS proxy only allows connecting to certain ports.

HTTPSProxyAuthenticator username:password

If defined, Tor will use this username:password for Basic HTTPS proxy authentication, as in RFC 2617. This is currently the only form of HTTPS proxy authentication that Tor supports; feel free to submit a patch if you want it to support others.

Socks4Proxy host[:port]

Tor will make all OR connections through the SOCKS 4 proxy at host:port (or host:1080 if port is not specified).

Socks5Proxy host[:port]

Tor will make all OR connections through the SOCKS 5 proxy at host:port (or host:1080 if port is not specified).

Socks5ProxyUsername username

Socks5ProxyPassword password

If defined, authenticate to the SOCKS 5 server using username and password in accordance to RFC 1929. Both username and password must be between 1 and 255 characters.

It seems, that you are searching especially for the first option (HTTPProxy) as you cannot connect to the directory servers. If you need a password to access the proxy, take a look at the HTTPProxyAuthenticator option, too.

mpy

Posted 2013-03-14T08:27:17.360

Reputation: 20 866

3

  1. Open the Vidalia Control Panel, click on Settings.
  2. Click Network. Select I use a proxy to access the Internet.
  3. On the Address line, enter the open proxy address. This can be a hostname or IP Address.
  4. Enter the port for the proxy.
  5. Generally, you do not need a Username and Password. If you do, enter the information in the proper fields.
  6. Choose the Type of proxy you are using, whether SOCKS4, or SOCKS5.
  7. Push the Ok button. Vidalia and Tor are now configured to use a proxy to access the rest of the Tor Network.

enter image description here

Tor FAQ: https://www.torproject.org/docs/faq.html.en

stderr

Posted 2013-03-14T08:27:17.360

Reputation: 9 300

3Vidalia is dead. – Robino – 2015-02-25T17:31:23.000