厌倦了滚动浏览相同的帖子?当您创建帐户后,您将始终回到您离开的地方。使用帐户,不仅可以享受无广告的清爽界面!
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 Alvis 于 2024-10-2 02:53 编辑
本贴仅讨论Realm转发,不要歪楼讨论代理相关内容!!遵守国家法律法规
1️⃣ 下载运行文件(自行去下面代码网址替换适合自己机器架构的版本):wget -O realm.tar.gz [url]https://github.com/zhboner/realm/releases/download/v2.4.6/realm-x86_64-unknown-linux-gnu.tar.gz[/url] && tar -xvf realm.tar.gz && chmod +x
Github被屏蔽的试试下面这个:
-O realm.tar.gz [url]https://mirror.ghproxy.com/https://github.com/zhboner/realm/releases/download/v2.4.6/realm-x86_64-unknown-linux-gnu.tar.gz[/url] && tar -xvf realm.tar.gz && chmod +x
2️⃣ 去/root文件夹下新建config.toml文件,并写入(具体远程IP和端口,本机端口自己改):[[endpoints]]
listen = "0.0.0.0:5000"
remote = "8.8.8.8:443"
[[endpoints]]
listen = "0.0.0.0:6000"
remote = "[2400:3200::1]:443"
3️⃣ 去/etc/systemd/system文件夹下新建realm.service文件,并写入:[Unit]
Description=realm
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
DynamicUser=true
WorkingDirectory=/root
ExecStart=/root/realm -c /root/config.toml
[Install]
WantedBy=multi-user.target
4️⃣ 启动服务:systemctl daemon-reload
systemctl enable realm
systemctl restart realm
systemctl status realm
更新:改了个一句话命令cd /tmp; \
wget -O realm.tar.gz https://github.com/zhboner/realm/releases/download/v2.4.6/realm-x86_64-unknown-linux-gnu.tar.gz; \
tar -xvf realm.tar.gz; \
chmod +x realm; \
cat > /root/config.toml <<EOF
[[endpoints]]
listen = "0.0.0.0:5000"
remote = "8.8.8.8:443"
[[endpoints]]
listen = "0.0.0.0:6000"
remote = "[2400:3200::1]:443"
EOF
cat /etc/systemd/system/realm.service <<EOF
[Unit]
Description=realm
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
DynamicUser=true
WorkingDirectory=/root
ExecStart=/root/realm -c /root/config.toml
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload; \
systemctl enable realm; \
systemctl restart realm; \
systemctl status realm
|