xqzr 2024-10-20 19:08:34 +08:00 committed by GitHub
commit 56bece2f87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 320 additions and 0 deletions

View File

@ -0,0 +1,9 @@
Xray 基于 HTTP/2 或 HTTP/3 的传输方式完整按照 HTTP 标准实现,可以通过其它的 HTTP 服务器(如 Caddy进行中转。
Caddy 使用 reverse_proxy 模块,一般使用 path 分流,主路径伪装为网站,中间人无法探测到 Xray-core请使用复杂 path
Caddy 默认开启 UDP 同端口的 HTTP/3 服务器,目前支持三种中转方式
- HTTP/2
- HTTP/3 解密后重新加密
- HTTP/3 转 H2C

View File

@ -1,6 +1,10 @@
xx.com {
log {
level DEBUG
}
root * /var/www
file_server
tls CA.crt priv.key # 换成你的证书和私钥,绝对路径
reverse_proxy /path 127.0.0.1:2001 {
transport http {

View File

@ -0,0 +1,17 @@
xx.com {
log {
level DEBUG
}
root * /var/www
file_server
tls CA.crt priv.key # 换成你的证书和私钥,绝对路径
reverse_proxy /path 127.0.0.1:2001 {
transport http {
tls
tls_client_auth CA.crt priv.key # 换成你的证书和私钥,绝对路径
tls_server_name xx.com
versions 3
}
}
}

View File

@ -0,0 +1,7 @@
# 原理图:
Xray client <--- H3 ---> Caddy2 <--- H3 ---> Xray server
注意:
由于 H3 没有解密的明文传输标准 这种模式 Caddy 解密流量之后 会重新加密 会增加少许延迟和负载
目前仅 Caddy2 的 v2.9.0-beta.2 版及以后完美支持 Xray 的 H3 入站。

View 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"
}
]
}
}

View File

@ -0,0 +1,66 @@
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 2001,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients": [
{
"id": "",
"email": "love@example.com"
}
],
"decryption": "none"
},
"streamSettings": {
"security": "tls",
"network": "http",
"httpSettings": {
"path": "/path",
"host": [
"xx.com"
]
},
"tlsSettings": {
// "rejectUnknownSni": true,
"minVersion": "1.3",
"alpn": ["h3"],
"certificates": [
{
"certificateFile": "CA.crt", //
"keyFile": "priv.key" //
}
]
}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
}
}

View 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 {
}
}

View File

@ -0,0 +1,5 @@
# 原理图:
Xray client <--- H3 ---> Caddy2 <--- H2C ---> Xray server
注意:
目前仅 Caddy2 的 v2.9.0-beta.2 版及以后完美支持 H3 转换 H2C 对接 Xray 的 H2C 入站。

View 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"
}
]
}
}

View 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"
}
]
}
}