因為很久沒更新 xray,所以只用舊版本測試。大家成功後,再更新版本或在config.json自訂更多的協議。
======
ASUS router 架設 VPN server 方法如下
進入華碩 web gui,『Enable JFFS custom scripts and configs』設定為 yes
windows電腦下載 Xray-core v1.8.24 https://github.com/XTLS/Xray-core/releases/tag/v1.8.24 的 Xray-linux-arm32-v5.zip
並且解壓縮。
WinSCP 在 /jffs/建立目錄 xray,將 geoip.dat、geosite.dat、xray 三個檔案上傳到 /jffs/xray/
修改讓 xray 有執行權限 (改成 744 )
方法請參考
無線分享器刷Merlin(梅林)後,安裝V2Ray+TLS Server及使用 Proxifier 代理流量過程分享 - Mobile01
或
【教學文】V2Ray + 華碩 router - 新一代翻牆教學完全免費版 | 企業號航行網誌
windows 下寫好 config.json,上傳到 /jffs/xray/。也可以 putty SSH 進入主機用 vi 或 nano 寫 config.json。
config.json 內容如最下方
(在 Online UUID Generator Tool 可以產生新的id)
putty SSH 連入 主機後,輸入以下指令執行 xray
nohup /jffs/xray/xray --config=/jffs/xray/config.json > /dev/null 2>&1 &
使用 ps | grep xray 指令查看 xray 有沒有執行成功,有成功會顯示如下
976 admin 546m S /jffs/xray/xray --config=/jffs/xray/config.json
如果沒有上面這一行,可能 port 被佔用。 改port後再執行 xray 指令
在 /jffs/scripts/ 的 service-start 或 init-start (權限 744) 內加入一行
nohup /jffs/xray/xray --config=/jffs/xray/config.json > /dev/null 2>&1 &
可於路由器啟動時,自動執行 xray。
===
client 端連線方法:
手機下載 VPN client 軟體。填入 IP, port, id 即可連線,範例如下

===
config.json 內容為
{
"log": {
"loglevel": "none"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 8081,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "605e7c22-5cc8-44a8-8643-80157a01018f",
"level": 0,
"email": "testxray@gmail.com"
}
],
"decryption": "none",
"fallbacks": [
{
"dest": "google.com:80"
}
]
},
"streamSettings": {
"network": "tcp"
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}




























































































