KANIKIG

KANIKIG

just for fun | 兴趣使然 Ph.D. in Engineering|❤️ #NFT $ETH| [Twitter](https://twitter.com/kanikig2)|[Github](https://github.com/KANIKIG)|[Telegram channel](https://t.me/kanikigtech)

Currently the most stable! Use Gost tunnel relay to build Telegram proxy

image

Preface#

Reading this article requires a certain level of Linux knowledge and understanding of Linux commands.

This article is completely original. Please indicate the source if reproduced.

Why use tunnel relay to build?#

There are several common problems with existing Telegram proxy methods:

  • Direct SOCKS connection: Easily blocked
  • Direct MTProto connection: Basically easily blocked
  • MTProto+TLS: Can effectively resist blocking, but due to the situation of direct connection routes, the latency is generally high
  • MTProto+relay: MTProto traffic is recognized in China, and NAT vendors generally prohibit the use of MTProto

So is there a way to avoid all of the above problems? That is to use tunnel relay to build a SOCKS proxy.

The basic principle is as follows:

Build a SOCKS proxy on a foreign landing machine, and use Gost on the domestic relay machine to establish an encrypted tunnel for bypassing the Great Firewall (tunnels are currently the best form of resistance to blocking).

Building tutorial#

Example#

The following example assumes:

  • Domestic NAT:
    • IP: A.A.A.A
    • Internal port: 11360
    • External port: 49698 (some vendors support mapping of internal and external ports to be consistent, here is an example of inconsistency, please manually create the mapping)
  • Landing SOCKS5:
    • Landing IP: B.B.B.B
    • SOCKS port: 7891
    • SOCKS username: 123456
    • SOCKS password: 654321

Please correspond your own parameters to the examples one by one, do not copy them.

Install Gost#

68747470733a2f2f692e6c6f6c692e6e65742f323032302f31322f31342f713735504f367332444d4963554b422e706e67.png

I have modified and enhanced the original EasyGost script, adding many features. You can see the specific features on the project page:

Project Address

One-click script:

wget --no-check-certificate -O gost.sh https://raw.githubusercontent.com/KANIKIG/Multi-EasyGost/master/gost.sh && chmod +x gost.sh && ./gost.sh

To run this script again, just enter ./gost.sh and press Enter.

Run this script on both the landing machine and the domestic NAT to select 1 and install Gost.

iShot2021-01-1809.35.59.png

For the domestic machine installation of Gost, please select the domestic acceleration source, otherwise it will be very slow to pull from GitHub.

Domestic NAT configuration#

We use the script to add Gost encrypted forwarding.

# Run the script
./gost.sh

Then follow the instructions to complete the operation. I will fill in according to the previous example, please correspond to your own parameters. The tunnel transmission type can be selected arbitrarily, but the relay and landing must be consistent.

iShot2021-01-1809.46.55.png

iShot2021-01-1809.51.34.png

Note that the destination port here cannot be the landing SOCKS port. It should be any other available port outside of it, only used to decrypt tunnel traffic. You can see the next step for details. I chose 443 in the previous text. If port 443 on the landing machine is occupied by a website, you can change it to any other port without affecting security.

Landing machine configuration#

The script has built-in SOCKS proxy one-click installation (built-in Gost).

# Run the script
./gost.sh

iShot2021-01-1809.39.54.png

After installation, use Telegram to directly connect to this SOCKS proxy to ensure that the direct connection is successful before proceeding with tunnel forwarding. (Once confirmed, close it. SOCKS without encryption will be blocked quickly)

Next, connect the tunnel landing end according to the instructions. I will fill in according to the previous example, please correspond to your own parameters.

iShot2021-01-1809.50.03.png

iShot2021-01-1809.51.59.png

Note that the traffic entry and the destination port filled in by the domestic machine must be consistent. Fill in the IP as 127.0.0.1, which is the IP of the local machine. The destination port here is the port on which the SOCKS proxy listens.

TG connection test#

Fill in as follows

Screenshot_2020-08-01-23-22-14.jpg

If it is found to be unsuccessful, please carefully check the correspondence between your own parameters and the examples.

Postscript#

Personal experience shows that the latency is very low, and the video loading speed is very fast. It is almost as smooth as using WeChat in China.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.