Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

next iteration on splithttp #3462

Merged
merged 3 commits into from
Jun 20, 2024
Merged

next iteration on splithttp #3462

merged 3 commits into from
Jun 20, 2024

Conversation

mmmray
Copy link
Collaborator

@mmmray mmmray commented Jun 20, 2024

as discussed at the end of #3412

  • querystring is gone, path is my new friend. /<session> and /<session>/<seq> is used. this is really conservative when it comes to special characters required, but it's difficult to extend IMO
  • "early data" is implemented, the client can now send GET and POST at the same time. the server spawns another goroutine per session, which cleans up the session if the GET request has not been sent within 30 seconds.
  • I found my use of ctx incorrect, and this caused randomly cancelled requests. This is a bug in 1.8.15 as well. Fixed it by using context.WithoutCancel, and making sure that dialContext uses ctxInner instead of the outer scopes' context

This PR is a breaking change from 1.8.15. Server 1.8.15 is incompatible with client 1.8.16, and vice versa.

this is a bit hard to review, if you want separate PRs let me know. I can maybe build PRs which use each other as base branch, to avoid merge conflicts.

@RPRX
Copy link
Member

RPRX commented Jun 20, 2024

this is a bit hard to review

比起来 review 代码我更喜欢发个新版让大家实测

@RPRX RPRX merged commit 8fe976d into main Jun 20, 2024
34 checks passed
@RPRX
Copy link
Member

RPRX commented Jun 20, 2024

感谢 PR!

@mmmray mmmray deleted the splithttp-2 branch June 21, 2024 00:34
@RPRX
Copy link
Member

RPRX commented Jun 21, 2024

https://github.com/XTLS/Xray-core/releases/tag/v1.8.16

下一步,你可以让 browser dialer 支持 SplitHTTP,这样我们就有 ALPN 带 h2 的 browser dialer 了,再加个 streaming request 模式

如果 CDN 支持 WebSocket over HTTP/2 或 streaming request 回源就更好了

@mmmray
Copy link
Collaborator Author

mmmray commented Jun 21, 2024

Next, you can make the browser dialer support SplitHTTP, so that we have ALPN browser dialer with h2

I have actually thought about it, but it cannot be widely used because of lack of mobile support. This seems like the bigger piece of work, and I have not arrived at a satisfying conclusion. Should the mobile browser acquire wakelock? How to do that on iOS? etc

I also still don't know if there are any actual issues with utls in Iran, and without mobile support it cannot be tested at a large scale (across ISPs, regions)

and add a streaming request mode

Is this so that browser dialer and splithttp can be used more efficiently if no CDN is used?

@RPRX
Copy link
Member

RPRX commented Jun 21, 2024

总之 browser dialer 支持 SplitHTTP 所需代码应该很简单,先写了再说

and add a streaming request mode

Is this so that browser dialer and splithttp can be used more efficiently if no CDN is used?

对,就只是为了 browser dialer,否则 no CDN 时有更好的选择

此外,SplitHTTP 没有 WebSocket 的 ALPN 问题,这是一大优势,应该写在文档中

如果 edgetunnel 也支持 SplitHTTP 就厉害了,不过 worker 请求数不太够用,不知道 pages 有没有限制

@mmmray
Copy link
Collaborator Author

mmmray commented Jun 21, 2024

cf workers and other "serverless" things are difficult because there is no global state, each request may hit different worker instance. store sessions table and upload reassembly buffer in workers kv

leninalive pushed a commit to amnezia-vpn/amnezia-xray-core that referenced this pull request Oct 29, 2024
* move to paths instead of querystrings

* permit early data on serverside

* early data for the client, fix context cancellation
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.

2 participants