手搓xray很简单

1.安装xray

bash -c “$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)” @ install

2.配置文件

nano /usr/local/etc/xray/config.json

3.配置示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
"log": {
"loglevel": "warning"
},
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "block"
}
]
},
"inbounds": [
{
"tag": "VLESS-REALITY-56265",//命名
"port": 56265,//端口
"listen": "0.0.0.0",
"protocol": "vless",
"settings": {
"clients": [
{
"id": " ",// 装好xray后,执行 xray uuid 生成
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"dest": "yahoo.com:443",//选择自己要偷的域名
"serverNames": [
"yahoo.com",
""
],
"publicKey": " ",//xray x25519生成
"privateKey": " ",//同上
"shortIds": [
"135a" //openssl rand -hex 8生成,或者留空
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
]
}

4.重启xray

systemctl restart xray

5.查看xray状态

systemctl status xray

6.设置开机启动

systemctl enable xray