Quick Tor and HTTP proxy setup on Ubuntu server

How to quick install and setup Tor with HTTP proxy on your Ubuntu server.

First we need to install tor itself and privoxy:

sudo apt-get install tor privoxy

Then update configuration file for privoxy sudo vim /etc/privoxy/config.

forward-socks5t / 127.0.0.1:9050 .
listen-address your_host_name:8118

Check if it works correct:

$ nc your_host_name 8118
GET /
HTTP/1.1 400 Invalid header received from client
Proxy-Agent: Privoxy 3.0.21
Content-Type: text/plain
Connection: close

Invalid header received from client.

Check if tor is running:

$ nc localhost 9050
GET /
HTTP/1.0 501 Tor is not an HTTP Proxy
Content-Type: text/html; charset=iso-8859-1
...

Simple ruby script to check your new IP address via our new HTTP proxy:

require 'open-uri'
puts open('http://myip.ru/index_small.php', proxy: URI.parse("http://your_server_name:8118")).read

Almost done.


Опубликовано: Апрель 20, 2016 ~