xhttp 五合一配置 ( reality 直连与过 CDN 共存, 附小白可抄的配置) #4118
Replies: 25 comments 65 replies
-
“下发”的意思是服务发布者设置好,发给客户端后客户端直接拿来用,所以在客户端的 |
Beta Was this translation helpful? Give feedback.
-
你回落 XHTTP_IN 应该取消 PROXY protocol 发送、删除 PROXY protocol 接受,否则你反代 XHTTP_IN 就不能匹配了。 |
Beta Was this translation helpful? Give feedback.
-
所以如果要 nginx 前置来做 sni,复用 443 端口,做上下行都偷自己的 xhttp + reality 应该咋配啊? |
Beta Was this translation helpful? Give feedback.
-
附上一份适用于小白的简化配置,不需要 nginx,但是 xhttp+reality 与 xhttp+TLS+CDN 不能共用 443 端口,如果要共用,必须通过 nginx 或 caddy 反代(参考正文的配置)。 一、xhttp+reality 直连服务端配置:
客户端配置:
注意:如果你的 VPS 是单栈(只有 IPv4 或只有 IPv6),那么客户端不能使用上下行分离;
二、xhttp+TLS 过 CDN服务端配置:
客户端配置:
由于 CDN 往往有多个可用 IP,因此你可以任选两个 CDN 的 IP 实现上下行分离:
|
Beta Was this translation helpful? Give feedback.
-
I'm using nginx with with preread names to backends
Here is my location ` location /VLSpdG9k {
my nginx.conf section http
I cant get real ip in my logs. Can anyone point me how to fix it? |
Beta Was this translation helpful? Give feedback.
-
我参考上附的“xhttp+TLS 过 CDN” 的配置在VPS中搭建的账号,域名是在CF中解析的,测试开启CF代理走CDN,
|
Beta Was this translation helpful? Give feedback.
-
太强了,使用xhttp+Reality替换XTLS(Vision)+Reality,延迟大降。 |
Beta Was this translation helpful? Give feedback.
-
我尝试打印了请求
无法获取任何ip
|
Beta Was this translation helpful? Give feedback.
-
搞好了,上行reality, 下行 cf, 最近cf发善心不用优选,都分配了香港的ip, 速度贼快 |
Beta Was this translation helpful? Give feedback.
-
有一个疑问请教下:对于五合一的场景下,从(1. XTLS(Vision)+Reality )回落到 (2. xhttp+Reality),服务端的配置文件中,(2. xhttp+Reality)为什么没有realitySettings的配置?是回落的时候默认继承了1的realitySettings么?没太明白是怎么实现的 |
Beta Was this translation helpful? Give feedback.
-
感谢大神分享👍。可以在ngnix那份配置的最下面server_name .yourdomain.com;这里加一个注释,提示填写。 |
Beta Was this translation helpful? Give feedback.
-
sing-box能不能用 |
Beta Was this translation helpful? Give feedback.
-
现在哪个手机客户端能支持XHTTP? |
Beta Was this translation helpful? Give feedback.
-
求问一下,xhttp是不是无法和xtls-rprx-vision 共存,我配置后会报错,flow必须留空才行 |
Beta Was this translation helpful? Give feedback.
-
必须用443端口吗? |
Beta Was this translation helpful? Give feedback.
-
有没有不用CDN的配置模版,服务器网络质量很好,用 uuu.aaa.com(上行) ddd.bbb.com(下行),要如何配置啊 |
Beta Was this translation helpful? Give feedback.
-
我遇到一个奇怪的问题。按照xhttp的说明,实现了quic过cdn,只要客户端alpn单独设置h3,使用packet-up模式即可。但是我尝试了各种客户端,包括openwrt上的passwall,linux和windows下的v2rayn,一开始网络是通的,但是很快就不通了,比如passwall只能ping google.com10几次左右就再也不通了。但是如果不过cdn,quic直连服务器就是一直通的,改为h2也是一直通的。我想知道是不是cloudflare对quic有什么限制?我已经打开了cloudflare的http3支持,直接访问伪装网站也是quic。我想问问其他人有没有类似的情况,你们的quic过cdn一直是通的吗?如果有人感兴趣,我也可以提供配置跟日志。 |
Beta Was this translation helpful? Give feedback.
-
How does the section |
Beta Was this translation helpful? Give feedback.
-
客户端clash meta的配置文件怎么写啊,大佬 |
Beta Was this translation helpful? Give feedback.
-
由于这里的域名有其它用途,而这里在Cloudflare的SSL设置启用了 “完全(严格)” ,而似乎正文所提供的Xray配置中, {
"name": "<CDN Domain, like b.yourdomain.com>"
"dest": "/dev/shm/nginx.sock"
"xver": 0
} 在使用浏览器测试访问CDN后域名时,Cloudflare仍然返回“此站点的连接不安全”,应该怎么办呢? |
Beta Was this translation helpful? Give feedback.
-
声明:本教程参考大神 Benjamin1919 的 #4118 讨论和大神 lxhao61 的 1_nginx.conf 配置及本人实践整理而来,可随意转载无须任何授权 本人也是小白,只有一个域名和一台VPS 准备工作1.域名{domain.com},VPS公网ip{pubip} CloudFlare配置DNS配置: VPS准备执行以下命令 安装nginx proxy manager
访问http://{vpslocalhost}:81 准备配置文件准备xray配置
准备nginx配置
准备本地web文件
安装xray服务在portainer的Stacks中创建xray-xhttp
访问 https://xray.domain.com 和 https://cdn.domain.com 将展示https://{www.website.com}网站内容 客户端配置如下:1.xtls(vision)+Reality 直连
|
Beta Was this translation helpful? Give feedback.
-
看了【五合一配置】,在下新手入門,大致梳理了一下入站的數據邏輯和流程,不知道我理解的對不對 三種協議組合的入站:
|
Beta Was this translation helpful? Give feedback.
-
"I noticed that I can directly access the homepage via the server's IP address, and it uses the certificate for “a.yourdomain.com” . |
Beta Was this translation helpful? Give feedback.
-
Under the current settings, the server can obtain the local real IP address. How can the local IP be hidden through configuration adjustments? |
Beta Was this translation helpful? Give feedback.
-
能否通过x-ui这种面板来实现 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
根据R佬的文章 #4113 ,写了 xhttp 五合一的配置,在同一台 VPS 的 443 端口实现了:
如果不需要这么复杂的组合,可以直接跳转 #4118 (comment) ,适合小白直接抄配置。
假设 reality 直连的域名是 a.yourdomain.com,过 CDN 的域名是 b.yourdomain.com。
(注:双端 xray-core 的版本不能低于 v24.12.15 )
一、服务端 Xray 的配置(仅展示入站的部分):
二、服务端 Nginx 的配置(仅展示 http 部分):
三、客户端 Xray 的配置(仅展示出站的部份):
四、补充说明:
五、几种代理方式可能的使用场景:
XTLS+Reality
① 客户端 GUI 不支持 xhttp;
② 不想开启 TCP 多路复用;
③ 想要尽可能低的延迟与尽可能高的上下行速度
上下行均为 xhttp+Reality
① VPS 去程和回程的线路都比较好;
② 想要尽可能低的延迟与尽可能高的上下行速度
上行 xhttp+TLS+CDN | 下行 xhttp+Reality
① 去程(客户端→VPS)线路较差,回程(VPS→客户端)线路较好;
② 日常使用更偏重下载,很少上传
上下行均为 xhttp+TLS+CDN
① VPS 去程和回程的线路都很差;
② 不希望 VPS 的 IP 暴露在公网;
③ VPS 的 IP 已被墙
上行 xhttp+Reality | 下行 xhttp+TLS+CDN
① 去程(客户端→VPS)线路较好,回程(VPS→客户端)线路较差;
② 日常使用更偏重上传,很少下载
六、xhttp 上传模式
理论上 packet-up 性能弱于 stream-up/one,但经过R佬的不断优化,packet-up 性能已经改善许多,非常接近 stream-up/one 。
如果没有上下行分离的需求,强烈建议选择 stream-one 模式,可解决访问某些网站的断流问题:
目前 Cloudflare 完美支持 stream-one 模式,其他 CDN 有待测试。
Beta Was this translation helpful? Give feedback.
All reactions