mirror of
https://github.com/XTLS/Xray-examples.git
synced 2025-09-18 05:04:28 +08:00
Add VLESS-H3-Caddy two modes
This commit is contained in:
11
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/Caddyfile
Normal file
11
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/Caddyfile
Normal file
@@ -0,0 +1,11 @@
|
||||
xx.com {
|
||||
log {
|
||||
level DEBUG
|
||||
}
|
||||
root * /var/www
|
||||
file_server
|
||||
tls CA.crt priv.key # 换成你的证书和私钥,绝对路径
|
||||
|
||||
reverse_proxy /path h2c://127.0.0.1:2001 {
|
||||
}
|
||||
}
|
5
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/README.md
Normal file
5
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# 原理图:
|
||||
Xray client <--- H3 ---> Caddy2 <--- H2C ---> Xray server
|
||||
|
||||
注意:
|
||||
目前仅 Caddy2 的 v2.9.0-beta.2 版及以后完美支持 H3 转换 H2C 对接 Xray 的 H2C 入站。
|
73
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/client.json
Normal file
73
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/client.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"log":{},
|
||||
"inbounds":[
|
||||
{
|
||||
"port":"1080",
|
||||
"protocol":"socks",
|
||||
"settings":{
|
||||
"auth":"noauth",
|
||||
"udp":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"port":"1081",
|
||||
"protocol":"http",
|
||||
"settings":{}
|
||||
}
|
||||
],
|
||||
"outbounds":[
|
||||
{
|
||||
"protocol":"vless",
|
||||
"settings":{
|
||||
"vnext":[
|
||||
{
|
||||
"address":"xx.com",
|
||||
"port":443,
|
||||
"users":[
|
||||
{
|
||||
"id":"",
|
||||
"encryption":"none"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings":{
|
||||
"network":"http",
|
||||
"security":"tls",
|
||||
"httpSettings":{
|
||||
"host":[
|
||||
"xx.com"
|
||||
],
|
||||
"path":"/path"
|
||||
},
|
||||
"tlsSettings":{
|
||||
"alpn":["h3"],
|
||||
"serverName":"xx.com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag":"direct",
|
||||
"protocol":"freedom",
|
||||
"settings":{}
|
||||
},
|
||||
{
|
||||
"tag":"blocked",
|
||||
"protocol":"blackhole",
|
||||
"settings":{}
|
||||
}
|
||||
],
|
||||
"routing":{
|
||||
"domainStrategy":"IPOnDemand",
|
||||
"rules":[
|
||||
{
|
||||
"type":"field",
|
||||
"ip":[
|
||||
"geoip:private"
|
||||
],
|
||||
"outboundTag":"direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
55
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/server.json
Normal file
55
VLESS-HTTP-Caddy/VLESS-H3-To-H2C-Caddy/server.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 2001,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "",
|
||||
"email": "love@example.com"
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"security": "none",
|
||||
"network": "http",
|
||||
"httpSettings": {
|
||||
"path": "/path",
|
||||
"host": [
|
||||
"xx.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
},
|
||||
{
|
||||
"tag": "blocked",
|
||||
"protocol": "blackhole",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "AsIs",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"geoip:private"
|
||||
],
|
||||
"outboundTag": "blocked"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user