手搓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

不会被偷跑流量的 REALITY

https://github.com/XTLS/Xray-examples/tree/main/VLESS-TCP-REALITY%20(without%20being%20stolen)

自用配置示例

config_server.jsonc

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
"log": {
"loglevel": "debug"
},
"inbounds": [
{
"tag": "dokodemo-in",
"port": 16666,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 16666, // 指向内网中的 reality 端口,示例是这个端口,如果要自己修改了记得这里和下面的 reality 入站都要修改
"network": "tcp"
},
"sniffing": { // 这里的 sniffing 不是多余的,别乱动
"enabled": true,
"destOverride": [
"tls"
],
"routeOnly": true
}
},
{
"listen": "127.0.0.1",
"port": 16666, // 见上 如果和其他服务冲突了可以换
"protocol": "vless",
"settings": {
"clients": [
{
"id": "658a9fd3-3740-4df1-9f2c-846b199c9461", // uuid,装好xray后,执行 xray uuid 生成
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
// 下方要求和普通 reality 一致,这里演示 dest 设置为 cloudflare 不被偷跑流量所以设置为 yahoo.com
// 你可以设置为其他 CF 网站,如果你的 dest 不是这种网站你也不用点了进来不是吗
"dest": "yahoo.com:443",
"serverNames": [
"yahoo.com"
],
"privateKey": "wK8S16fAwx18fTlUW-kqBbFsx40Je898es1F0j_DWWw", // 运行 `xray x25519` 生成
"publicKey": "dGOEx_o20MJDAedTN6K3Ri7v2j6KH2KvlxhK3UluWEc",// 同上
"shortIds": [
"",
"8bc9dcb3a49c4270"//openssl rand -hex 8生成,或者留空
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls",
"quic"
],
"routeOnly": true
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
],
"routing": {
"rules": [
{
"inboundTag": [
"dokodemo-in"
],
// 重要,这个域名列表需要和 realitySettings serverNames 保持一致
"domain": [
"yahoo.com"
],
"outboundTag": "direct"
},
{
"inboundTag": [
"dokodemo-in"
],
"outboundTag": "block"
}
]
}
}

分享链接

1
vless://658a9fd3-3740-4df1-9f2c-846b199c9461@你的IP地址或域名:16666?encryption=none&flow=xtls-rprx-vision&security=reality&sni=yahoo.com&fp=chrome&pbk=dGOEx_o20MJDAedTN6K3Ri7v2j6KH2KvlxhK3UluWEc&sid=8bc9dcb3a49c4270&spx=%2F&type=tcp&headerType=none#dokodemo-in

自己修改了服务端的哪些东西,对应的分享链接也需要对应修改

一键脚本

1
wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/2253845067/Xray_install/main/install.sh" && chmod +x install.sh && bash install.sh

github地址:https://www.github.com/2253845067/Xray_install