Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 3 commits into from
Jun 23, 2024

Conversation

mmmray
Copy link
Collaborator

@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
34 checks passed
@yuhan6665
Copy link
Member

Thanks! Looks good to me!

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

RPRX commented Jun 27, 2024

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

@mmmray
Copy link
Collaborator 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.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants