realm组建隧道

mkdir /root/RealM
wget -P /root/RealM https://github.com/zhboner/realm/releases/download/v2.5.1/realm-x86_64-unknown-linux-gnu.tar.gz

解压

cd /root/RealM
tar -zxvf realm-x86_64-unknown-linux-gnu.tar.gz
chmod +x realm

新建一个配置文件

vi /root/RealM/config.toml

输入内容如下:
[log]
level = "warn"
output = "/var/log/realm.log"

[network]
no_tcp = false
use_udp = true

[[endpoints]]
listen = "0.0.0.0:20066"
remote = "127.0.0.1:53838"
listen_transport = "ws;host=www.bing.com;path=/;tls;servername=www.bing.com"

上述配置,listen段为中转鸡的传入端口,remote段为上文创建的socks端口,listen_transport段为隧道伪装的domain,自行更改。

保存后接着设置realm的systemd方便管理。

vi /etc/systemd/system/realm.service
[Unit]
Description=RealM
After=network.target
Wants=network.target

[Service]
WorkingDirectory=/root/RealM/
ExecStart=/root/RealM/realm -c /root/RealM/config.toml
Restart=on-abnormal
RestartSec=5s
KillMode=mixed

StandardOutput=null
StandardError=syslog

[Install]
WantedBy=multi-user.target

自行更改配置中WorkingDirectory/ExecStart段内容为realm所在的路径位置。

保存,启动

systemctl daemon-reload
systemctl start realm

检查realm是否启动正常

systemctl status realm   #状态检查
systemctl enable realm   #开机自启
systemctl disable realm  #删除开机自启

国内鸡

只需要参考上文安装realm,参考以下配置文件

[log]
level = "warn"
output = "/var/log/realm.log"

[network]
no_tcp = false
use_udp = true

[[endpoints]]
listen = "0.0.0.0:20088"
remote = "2.2.2.2:20066"
remote_transport = "ws;host=www.bing.com;path=/;tls;sni=www.bing.com;insecure"

上述配置,listen段为TG代理的连接端口,可自定义。remote段为上文创建的外地鸡的传入端口,listen_transport段为隧道伪装的domain,自行更改。

保存后参考上文增加systemd配置并启动

systemctl start realm

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注