Skip to content

Commit b0a0140

Browse files
committed
feat(xray-any-https)
1 parent d2d4547 commit b0a0140

4 files changed

Lines changed: 148 additions & 100 deletions

File tree

README.md

Lines changed: 11 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
不推荐使用xhttp,若喜欢玩cdn,可以自行研究
99

10+
若配置有问题的话可以提issue,若有什么不明白的也可以提issue,我很乐意回答
11+
1012
## 一键部署xray服务器(reality)
1113
### 使用
1214
> bash <(curl -Ls https://raw.githubusercontent.com/TwoOnefour/xray_configuration/refs/heads/main/setup.sh)
@@ -16,14 +18,19 @@
1618
此脚本会生成订阅配置,源代码可以访问这个url看或者直接看仓库内的setup.sh
1719

1820
### 内容
19-
#### vless-vision-reality
21+
建议配合[官方文档阅读](xray.github.io)
22+
23+
#### [vless-vision-reality](https://github.com/TwoOnefour/xray_configuration/tree/main/vless-vision-reality)
2024
我目前正在稳定使用的代理配置,已支持抗量子配置(mldsa), 预链接配置(仅客户端需要配置)
2125

22-
#### xray_with_frp
26+
#### [xray-any-https(进阶配置阅读推荐)](https://github.com/TwoOnefour/xray_configuration/tree/main/xray-any-https)
27+
xray一个端口复用很多种逻辑的配置
28+
29+
#### [xray_with_frp](https://github.com/TwoOnefour/xray_configuration/tree/main/xray_with_frp)
2330
我的frp通过路径,配合xray可以实现加密frp反代流量
2431

25-
#### xray_reverse_proxy
26-
xray的反向代理,和frp一样的功能
32+
#### [xray_reverse_proxy](https://github.com/TwoOnefour/xray_configuration/tree/main/xray_reverse_proxy)
33+
xray的反向代理,和frp一样的功能, 其中还有 vless encrytion 的示例配置
2734

2835
## 碎碎念
2936
可以不看
@@ -35,99 +42,3 @@ xray的反向代理,和frp一样的功能
3542
3. 不要直连ssh
3643
4. 不要使用明文http面板
3744
5. 如果你会的话,你可以在443开一个按sni分流的rule,`tunnel`入栈,回落到其他逻辑比如自己的nginx,作为伪装站
38-
39-
**实例**
40-
41-
`server-config.json`服务端配置
42-
43-
```server-config.json
44-
{
45-
"inbounds": [
46-
{
47-
"tag": "dokodemo-in",
48-
"port": 443,
49-
"protocol": "dokodemo-door",
50-
"settings": {
51-
"followRedirect": false,
52-
"network": "tcp"
53-
},
54-
"sniffing": {
55-
"enabled": true,
56-
"destOverride": [
57-
"tls"
58-
],
59-
"routeOnly": true
60-
}
61-
},
62-
{
63-
"listen": "127.0.0.1",
64-
"port": 4431,
65-
"protocol": "vless",
66-
"settings": {
67-
"clients": [
68-
{
69-
"id": "xxxxx",
70-
"flow": "xtls-rprx-vision"
71-
}
72-
],
73-
"decryption": "none"
74-
},
75-
"streamSettings": {
76-
"network": "tcp",
77-
"security": "reality",
78-
"realitySettings": {
79-
"dest": "speed.cloudflare.com:443",
80-
"serverNames": [
81-
"speed.cloudflare.com"
82-
],
83-
"privateKey": "xxxx",
84-
"shortIds": [
85-
"xxx"
86-
]
87-
}
88-
},
89-
"sniffing": {
90-
"routeOnly": true,
91-
"enabled": true,
92-
"destOverride": [
93-
"http",
94-
"tls",
95-
"quic"
96-
]
97-
},
98-
"tag": "vless-in"
99-
}
100-
],
101-
"outbounds": [
102-
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4v6" }, "tag": "direct" },
103-
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4", "redirect": "127.0.0.1:4431" }, "tag": "to-vless" },
104-
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4", "redirect": "127.0.0.1:4432" }, "tag": "to-alist" }, // alist反代
105-
{ "protocol": "blackhole", "tag": "block" }
106-
],
107-
"routing": {
108-
"rules": [
109-
{ "inboundTag": ["dokodemo-in"], "domain": ["speed.cloudflare.com"], "outboundTag": "to-vless" },
110-
{ "inboundTag": ["dokodemo-in"], "domain": ["alist.example.com"], "outboundTag": "to-alist" },
111-
{ "inboundTag": ["dokodemo-in"], "outboundTag": "block" }
112-
]
113-
}
114-
}
115-
```
116-
117-
**nginx配置示例**
118-
```/etc/nginx/conf.d/alist.conf
119-
server {
120-
listen 127.0.0.1:4432 ssl;
121-
ssl_certificate "/etc/nginx/example/fullchain.cer";
122-
ssl_certificate_key "/etc/nginx/example/cerkey.key";
123-
ssl_protocols TLSv1.3 TLSv1.2;
124-
server_name alist.example.com;
125-
126-
location / {
127-
proxy_pass http://127.0.0.1:20010;
128-
}
129-
}
130-
```
131-
132-
### dokodemo-door入站的好处?
133-
你可以开一个sniffing,根据sni分流你想要的节点/网站,一个端口可以复用

xray-any-https/nginx.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
server {
2+
listen 127.0.0.1:4432 ssl;
3+
ssl_certificate "/etc/nginx/example/fullchain.cer";
4+
ssl_certificate_key "/etc/nginx/example/cerkey.key";
5+
ssl_protocols TLSv1.3 TLSv1.2;
6+
server_name alist.example.com;
7+
8+
location / {
9+
proxy_pass http://127.0.0.1:20010;
10+
}
11+
}
12+
13+
server {
14+
listen 127.0.0.1:4432 ssl;
15+
ssl_certificate "/etc/nginx/example/fullchain.cer";
16+
ssl_certificate_key "/etc/nginx/example/cerkey.key";
17+
ssl_protocols TLSv1.3 TLSv1.2;
18+
server_name emby.example.com;
19+
20+
location / {
21+
proxy_pass http://127.0.0.1:20011;
22+
}
23+
}

xray-any-https/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rule+sniffing用的好的话,你可以玩出花来,比如一个端口多个网站,兼顾代理,建站,切换家宽等等

xray-any-https/server.json

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"inbounds": [
3+
{
4+
"tag": "dokodemo-in",
5+
"port": 443,
6+
"protocol": "dokodemo-door",
7+
"settings": {
8+
"followRedirect": false,
9+
"network": "tcp"
10+
},
11+
"sniffing": {
12+
"enabled": true,
13+
"destOverride": [
14+
"tls"
15+
],
16+
"routeOnly": true
17+
}
18+
},
19+
{
20+
"listen": "127.0.0.1",
21+
"port": 4433,
22+
"protocol": "vless",
23+
"settings": {
24+
"clients": [
25+
{
26+
"id": "xxxxx",
27+
"flow": "xtls-rprx-vision"
28+
}
29+
],
30+
"decryption": "none"
31+
},
32+
"streamSettings": {
33+
"network": "tcp",
34+
"security": "reality",
35+
"realitySettings": {
36+
"dest": "speedtest.net:443",
37+
"serverNames": [
38+
"speedtest.net"
39+
],
40+
"privateKey": "xxxx",
41+
"shortIds": [
42+
"xxx"
43+
]
44+
}
45+
},
46+
"sniffing": {
47+
"routeOnly": true,
48+
"enabled": true,
49+
"destOverride": [
50+
"http",
51+
"tls",
52+
"quic"
53+
]
54+
},
55+
"tag": "vless-in-2"
56+
},
57+
{
58+
"listen": "127.0.0.1",
59+
"port": 4431,
60+
"protocol": "vless",
61+
"settings": {
62+
"clients": [
63+
{
64+
"id": "xxxxx",
65+
"flow": "xtls-rprx-vision"
66+
}
67+
],
68+
"decryption": "none"
69+
},
70+
"streamSettings": {
71+
"network": "tcp",
72+
"security": "reality",
73+
"realitySettings": {
74+
"dest": "speed.cloudflare.com:443",
75+
"serverNames": [
76+
"speed.cloudflare.com"
77+
],
78+
"privateKey": "xxxx",
79+
"shortIds": [
80+
"xxx"
81+
]
82+
}
83+
},
84+
"sniffing": {
85+
"routeOnly": true,
86+
"enabled": true,
87+
"destOverride": [
88+
"http",
89+
"tls",
90+
"quic"
91+
]
92+
},
93+
"tag": "vless-in"
94+
}
95+
],
96+
"outbounds": [
97+
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4v6" }, "tag": "direct" },
98+
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4", "redirect": "127.0.0.1:4431" }, "tag": "to-vless" }, // 根据sni分流的第一个入口
99+
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4", "redirect": "127.0.0.1:4433" }, "tag": "to-vless-2" }, // 根据sni分流的第二个入口
100+
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv6" }, "tag": "to-homeboardbone" }, // 根据sni分流的第二个出口,简化了出站逻辑为使用ipv6,你可以换成你想要的协议出栈
101+
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIPv4", "redirect": "127.0.0.1:4432" }, "tag": "to-nginx" }, // nginx反代
102+
{ "protocol": "blackhole", "tag": "block" }
103+
],
104+
"routing": {
105+
"rules": [
106+
{ "inboundTag": ["dokodemo-in"], "domain": ["speed.cloudflare.com"], "outboundTag": "to-vless" }, // 根据sni分流的第一个入口
107+
{ "inboundTag": ["dokodemo-in"], "domain": ["speedtest.net"], "outboundTag": "to-vless-2" }, // 根据sni分流的第二个入口
108+
{ "inboundTag": ["vless-in-2"], "outboundTag": "to-homeboardbone" }, // 你可以写根据sni分流的第二个出口,比如分流到家宽,直接切换sni到上面对应的域名即可
109+
{ "inboundTag": ["dokodemo-in"], "domain": ["alist.example.com", "emby.example.com"], "outboundTag": "to-alist" }, // nginx反代
110+
{ "inboundTag": ["dokodemo-in"], "outboundTag": "block" }
111+
]
112+
}
113+
}

0 commit comments

Comments
 (0)