Sign inSign up

rajwebconsulting/tor-proxy

By rajwebconsulting

•Updated about 7 years ago

Tor SOCKS5 Proxy with Control Protocol, without relay/exit feature, based on Alpine Linux.

Image
2

799

rajwebconsulting/tor-proxy repository overview

Image

⁠This is a Tor SOCKS5 Proxy with Control Protocol, without relay/exit feature, based on Alpine Linux, and intended for use with https://rajwebconsulting.com/#products⁠ .

⁠Ports used: SOCKS5 Port: 9250 / Control Port: 9251
⁠(NOTE: The $ character signifies a command prompt. Your command prompt may look different. So, when you see a $ character preceding a line, it is your cue to execute the ensuing command in the console. Do NOT include the $ character in the command!)
⁠First, review "install-docker.pdf", determine if you need to install docker, and follow the instructions as needed.

⁠Generate hashed Tor control protocol password
  • In the following command, YOUR_PASSWORD is any "alphanumeric" password that you choose. Make it a good one!
$ docker run -it --name tor_proxy rajwebconsulting/tor-proxy:latest tor --hash-password YOUR_PASSWORD
⁠Copy the resulting hashed password and save it in a safe place. You will need it later!
  • Your hashed password will look something like this: "16:54972B82DADE561F600086569E3AAD14A1E484013DCB6440DBBADE950B"
⁠Create a Docker folder in home directory
$ mkdir /home/docker
⁠Copy Tor Config file (inside docker image) to the physical host (your server)
$ docker cp tor_proxy:/etc/tor /home/docker/proxy
⁠Enter your hashed password into Config file
  • Open /home/docker/proxy/tor/torrc on your server and enter your hashed password on the line that starts with "HashedControlPassword"
  • I.e., replace "16:54972B82DADE561F600086569E3AAD14A1E484013DCB6440DBBADE950B" in "HashedControlPassword 16:54972B82DADE561F600086569E3AAD14A1E484013DCB6440DBBADE950B" with your new hashed password!
⁠Configure geo-restrictions for Tor proxy IPs
  • While /home/docker/proxy/tor/torrc is still open, look for the following lines:
  • ## If you want to use Specific Exit Nodes
  • ## then uncomment StrictExitNodes and ExitNodes
  • ## Use Country Codes in Brackets to use Country Specific Exit Nodes
  • #StrictExitNodes 1
  • #ExitNodes {de},{ch},{nl},{fr},{at}
  • Then, e.g., update these lines like so if you want only German and French IPs:
  • ## If you want to use Specific Exit Nodes
  • ## then uncomment StrictExitNodes and ExitNodes
  • ## Use Country Codes in Brackets to use Country Specific Exit Nodes
  • StrictExitNodes 1
  • ExitNodes {de},{fr}
  • You can replace country codes and/or add/remove them as needed.
⁠Remove temporary Container
$ docker rm tor_proxy
⁠Run Tor SOCKS5 Proxy with Control Protocol and Volume Mapping
$ docker run -d --restart always --name tor_proxy -p 127.0.0.1:9250:9250 -p 127.0.0.1:9251:9251 -v /home/docker/proxy:/etc/tor rajwebconsulting/tor-proxy:latest
⁠Finally, open "lib/Config.php" or "Config.class.php" (in our software products) and set the following constant values:
const _ENABLE_IP_ROTATION = true;
const _ENABLE_TOR_PROXY = true;
const _TOR_PROXY_PASSWORD = "YOUR_PASSWORD"; // in Plain Text. Not the Hashed Password
  • (FYI - This is the same password that you used in the "Generate hashed Tor control protocol password" section above. Note: You MUST enter the password in "plain text" here and NOT the password hash!)
⁠You're done! :-) Enjoy the benefits of the Tor network!

Tag summary

Content type

Image

Digest

Size

8.3 MB

Last updated

about 7 years ago

docker pull rajwebconsulting/tor-proxy