1

Since the internet restrictions in Iran have become more severe as of October 2022, nowadays many Iranians are trying different methods to bypass censorship and connect to Telegram.

For example, using various proxies and VPNs. So I'd like to encourage them to use Tor - one of the most advanced and secure online anonymity tools. But some of those people seem to gripe that Tor doesn't work in Iran or that Tor's connection is extremely slow, humorously describing its speed as like a turtle with spinal cord injuries.

So I was wondering if there is a way to install and use Tor with Snowflake client on Termux, the Linux Terminal Emulator, which is probably a light-weight app and can therefore be used instead of the official Tor Browser and Orbot apps to provide faster performance.

After the installation, I also want to set a proxy in my Telegram so that all the Telegram's traffic will be relayed through the Tor Network. So could you help me do so?

0

1 Answer 1

0

I did a Google search and found this post on Ask Ubuntu site, which discussed how to install and use Tor with Snowflake bridge on Ubuntu 20.04 (NOT Termux). Based on what I learned from that post, I figured out a similar solution for Termux, which worked just fine after I tested it on two Android phones. However, after the installation of Tor and Snowflake on those phones, the Termux app took up a very large amount of the phone's storage space, which might be an issue of my approach. Below you can find instructions for installation and instructions for usage.

(Only for Android version 7 or higher)

Instructions to install

For the initial installation of Tor and Snowflake client on Termux, it is required that you have a separate VPN and keep it connected while performing Steps 1 through 4. After accomplishing Step 4, you no longer need that VPN, so you can disconnect it and/or even uninstall it from your device. Follow the instructions below:

  1. First, download and install the latest version of Termux app from FDroid website. You do not need to download the F-Droid app (via the Download F-Droid link) to install Termux. You can download the Termux APK directly from the site by clicking the Download APK link at the bottom of each version section.
  2. Open Termux and execute the following commands to install the packages required for Tor and Snowflake client.
pkg upgrade
pkg install tor golang git nano -y
  1. Then execute the following command to download Snowflake source code.
git clone https://git.torproject.org/pluggable-transports/snowflake.git
  1. Next, compile that source code by executing the below commands one-by-one.
cd snowflake/client
go get
go build
cd $HOME
  1. Now it's time to configure Tor to use Snowflake bridge for connection. To do so, open the Tor's configuration file (known as torrc) in the Nano editor, by executing the following.
nano $PREFIX/etc/tor/torrc
  1. Then in the Nano editor, scroll down to the end of the file, and append the three lines of code below.
UseBridges 1
ClientTransportPlugin snowflake exec /data/data/com.termux/files/home/snowflake/client/client
Bridge snowflake 192.0.2.3:80 2B280B23E1107BB62ABFC40DDCC8824814F80A72 fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=cdn.sstatic.net ice=stun:stun.l.google.com:19302,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
  1. Then you must save the changes you made to the file, by pressing CTRL+O. Then you will be asked to specify a file name; don't type anything and just press Enter, so that the file name will remain the current one (torrc).
  2. Close the Nano editor by pressing CTRL+X.
  3. Close Termux by pressing CTRL+D, and open Telegram app.
  4. In Telegram, go to Proxy Settings, then add a SOCKS5 proxy with the following information:
    Server: 127.0.0.1
    Port: 9050
    Username: admin
    Password: admin

During the installation, if you haven't received any error messages so far, it means Tor installation on Termux has been successfully completed.

Instructions to use

After successful Tor installation, whenever desired, you can enable Tor and then easily connect to Telegram. To enable Tor, simply open Termux and execute tor. Then Tor will start establishing a connection to the Tor Network, and display some logs indicating the progress. So you must wait until the progress reaches 100%, i.e. you get the following message in the logs:

[NOTICE] Bootstrapped 100% (done): Done

Finally, you can open Telegram and let it connect through the Tor proxy.

Please note that after you finished using Telegram, it is highly recommended that you disable Tor and exit Termux, otherwise Termux would unnecessarily consume your battery power in the background.

Disabling Tor is really simple: just go to Termux and press CTRL+C; upon success, you'll get the following message.

Interrupt: exiting cleanly.

Next, exit Termux by pressing CTRL+D.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .