Skip to content

splithttp: Add support for H2C and http/1.1 ALPN on server#3465

Merged
yuhan6665 merged 3 commits intoXTLS:mainfrom
mmmray:splithttp-h2c
Jun 23, 2024
Merged

splithttp: Add support for H2C and http/1.1 ALPN on server#3465
yuhan6665 merged 3 commits intoXTLS:mainfrom
mmmray:splithttp-h2c

Conversation

@mmmray
Copy link
Copy Markdown
Contributor

@mmmray mmmray commented Jun 21, 2024

Partially address #3464

H2C support is required so that fallbacks can work with splithttp at all. fallback with path-based routing still doesn't work.

Users that encounter protocol version issues will likely try to set the
ALPN explicitly. In that case we should simply grant their wish, because
the intent is obvious.
@mmmray mmmray changed the title Add H2C support to splithttp server splithttp: Add support for H2C and http/1.1 ALPN on server Jun 22, 2024
@yuhan6665 yuhan6665 merged commit ee2000f into XTLS:main Jun 23, 2024
@yuhan6665
Copy link
Copy Markdown
Member

Thanks! Looks good to me!

@mmmray mmmray deleted the splithttp-h2c branch June 24, 2024 19:27
@RPRX
Copy link
Copy Markdown
Member

RPRX commented Jun 27, 2024

几天前看了下代码才明白为啥客户端不好处理 ALPN,原来要先确定用 h1 还是 h2 再给它 TLS,不过 Go 好像提供了一个升级方法

@mmmray
Copy link
Copy Markdown
Contributor Author

mmmray commented Jun 27, 2024

@RPRX the issue is really specific to uTLS. When a regular crypto/tls object is passed around, it somehow starts working due to type-casting magic in net/http.

The upgrade method, I couldn't find, but I think I tried all the APIs ("next protocol" callback in net/http, etc), didn't work. Maybe this problem needs fresh eyes.

leninalive pushed a commit to amnezia-vpn/amnezia-xray-core that referenced this pull request Oct 29, 2024
* Add H2C support to server

* update comment

* Make http1.1 ALPN work on SplitHTTP client

Users that encounter protocol version issues will likely try to set the
ALPN explicitly. In that case we should simply grant their wish, because
the intent is obvious.
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
* Add H2C support to server

* update comment

* Make http1.1 ALPN work on SplitHTTP client

Users that encounter protocol version issues will likely try to set the
ALPN explicitly. In that case we should simply grant their wish, because
the intent is obvious.
drovosek229 pushed a commit to drovosek229/Xray-core that referenced this pull request Mar 16, 2026
* Add H2C support to server

* update comment

* Make http1.1 ALPN work on SplitHTTP client

Users that encounter protocol version issues will likely try to set the
ALPN explicitly. In that case we should simply grant their wish, because
the intent is obvious.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants