V2ray-core: HTTP/2 无法穿过CloudFlare之类的CDN。(似乎"allowInsecure": true对HTTP2不管用)

Created on 22 Jun 2019  ·  5Comments  ·  Source: v2ray/v2ray-core

如果使用WS,开/关CloudFlare都能正常使用。(开了后使用CloudFlare的IP,关了后使用真实IP,都能正常使用)

但如果使用HTTP2,一开CloudFlare就完全无法联通(客户端显示错误Protocal Error),关了CloudFlare后就完全正常使用。

怀疑:因为HTTP2服务器绑定了我自己域名的真实证书。 直接连接时,服务端和客户端获得相同证书,握手成功。 但如果使用CloudFlare中转服务,再访问我的域名时,客户端将获得CloudFlare提供的证书(因为它隐藏了我真实的IP,它给我的域名<->它自己的IP发了另一个证书)。V2ray服务端和客户端的证书不同,导致握手失败。

尝试解决:给服务器和客户端,都加上了"allowInsecure": true参数,认为它能让v2ray忽略证书的不匹配。结果失败。

个人肤浅的建议:能否使v2ray在使用http2时,遵守allowInsecure参数,能够忽略证书错配?

Most helpful comment

The HTTP/2 specification is focused on improving the browser behavior at this point. Therefore we do not support SPDY or HTTP/2 between origin server and Cloudflare at this point. Instead we will always use HTTP/1.x. With this, it is not necessary to make any modifications to the origin for enabling HTTP/2 or SPDY.

ref: https://support.cloudflare.com/hc/en-us/articles/214534978-Are-the-HTTP-2-or-SPDY-protocols-supported-between-Cloudflare-and-the-origin-server-

All 5 comments

cf不支持http2

cf支持http2的,而且还是当年众多CDN中最早支持h2加速的。

我的设置中,CloudFlare的http2选项确认打开,并且网站成功通过了http2代理加速,就是v2ray失败。

The HTTP/2 specification is focused on improving the browser behavior at this point. Therefore we do not support SPDY or HTTP/2 between origin server and Cloudflare at this point. Instead we will always use HTTP/1.x. With this, it is not necessary to make any modifications to the origin for enabling HTTP/2 or SPDY.

ref: https://support.cloudflare.com/hc/en-us/articles/214534978-Are-the-HTTP-2-or-SPDY-protocols-supported-between-Cloudflare-and-the-origin-server-

楼上大神!我用了CF那么多年,从来都没看到这部分帮助内容!竟然你能翻出来。

原来CF的HTTP2代理是“假的”,浮于表面上的。它把我网页上的内容用普通方式抓取后再用HTTP2协议发给用户,而不是把我网站的HTTP2协议直接中转给用户。V2ray的h2数据流肯定无法通过这样的代理。

完全明白了。这不是V2ray的锅。我老老实实回去用已经多年很稳定的WS去了。(我这就是瞎折腾啊)

CloudFlare最近有没有完整支持HTTP/2的想法?

Was this page helpful?
0 / 5 - 0 ratings