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

[Feature-Request] splithttp using http3 #3456

Closed
Mfire2001 opened this issue Jun 18, 2024 · 16 comments
Closed

[Feature-Request] splithttp using http3 #3456

Mfire2001 opened this issue Jun 18, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@Mfire2001
Copy link

I just saw the new realease and saw httpsplit,from my undrasting it works by having multiple connections for upload and download and can be used with cdns without websocket
Is it possible to have the same thing with http3?cloudflare supports quic but I think it deliveres connections to origin server using http1.1
This is what came to my brain:the server side is the same but the client send each GET /?session= and POST /?session= using http3 instead of http1.1 or h2

@Fangliding
Copy link
Member

H3 is probably too complicated, especially now there are still many issues with QUIC

@mmmray
Copy link
Collaborator

mmmray commented Jun 18, 2024

the transport just uses golang http.Client, you can probably replace http2.Transport with this: https://pkg.go.dev/github.com/quic-go/quic-go/http3#RoundTripper

and it could work.

if it's useful, I think depends on the country...

but yeah i have no idea how things like utls would work with it

@Mfire2001
Copy link
Author

H3 is probably too complicated, especially now there are still many issues with QUIC

U are right, but i think it kinda worth it,since quic has built in multiplexing and u can have all the get and post requests using the same udp socket,xray uses http.client for handling requests right?I will see xray's code and see what I can do,

@mmmray
Copy link
Collaborator

mmmray commented Jun 18, 2024

U are right, but i think it kinda worth it,since quic has built in multiplexing

h2 already has mux, and with less annoyance around utls (still quite a bit of annoyance!). it's likely that there is only one tcp connection per connection in the end. it would need a different motivation, maybe to blend in with other quic traffic or to achieve some performance goal, but it seems unlikely. also, if iran can just block UDP for fun, is it worth it?

but I think it should be prototyped, I think it is possible that the performance is better than h2.

@PoneyClairDeLune
Copy link
Contributor

PoneyClairDeLune commented Jun 18, 2024

My two pennies on this: It's not really worth it to pair any form of Meek with HTTP/3.

UDP packets are usually under heavy scrutiny in repressive regimes, often made slower than the equivalent transports over TCP. If you want to argue on general performance, it's not possible to force CDNs to use a custom flavour of congestion control algorithm; heck, for direct connections, there already exist a whole bunch of fully-duplex and performant solutions.

To Meek itself, in all intents and purposes, is a technique reconstructing states over underlying transports. Between reconstructed and native duplex connections, I don't think any sane person would choose the former any day.

However, Meek over DNS has greater potential, despite it always being a dial-up sim. Iodine is a (kinda) great example.

@mmmray
Copy link
Collaborator

mmmray commented Jun 18, 2024

I will see xray's code and see what I can do

Right, so here: https://github.com/XTLS/Xray-core/blob/main/transport/internet/splithttp/dialer.go#L102

...h2 is enabled for all TLS connections

I suggest to try and replace http2.Transport with http3.Transport, basically

I think there are implications for how connections are created (I don't think the existing dialContext will work at all anymore), but let's see :)

@Fangliding
Copy link
Member

What I want to say is that the main purpose of this protocol is to pass through CDN, and even Cloudflare does not support h3 to origin, let alone other CDN.
If not use CDN, just as PoneyClairDeLune said there already be many good solutions.

@mmmray
Copy link
Collaborator

mmmray commented Jun 18, 2024

In theory http3 deals with packet loss better due to lack of head of line blocking, and there is plenty of packet loss in iran between CDN and user. so it could still pay off, even if the requests get converted to HTTP/1.1

(the issue with origin requests isn't even the CDN... the xray server only supports HTTP/1.1 🙈) wrong, xray server supports all protocols, h1, h2, tls, doesn't matter

@Fangliding
Copy link
Member

In theory http3 deals with packet loss better due to lack of head of line blocking, and there is plenty of packet loss in iran between CDN and user. so it could still pay off, even if the requests get converted to HTTP/1.1

(the issue with origin requests isn't even the CDN... the xray server only supports HTTP/1.1 🙈)

Don't have too much hope for the performance of QUIC. One of the problems I just mentioned one of ray's QUIC issues is that its performance is worse than that of TCP protocol in the same network environment, not to mention the attitude of middle box towards UDP packets

@APT-ZERO
Copy link

APT-ZERO commented Jun 19, 2024

one of ray's QUIC issues is that its performance is worse than that of TCP protocol in the same network environment

Because nobody touched Xray's QUIC code for years, performance of Sing-Box QUIC Based protocols are great

@mmmray
Copy link
Collaborator

mmmray commented Jun 19, 2024

@APT-ZERO it's true that hy2 works well. i am not sure the ideas can be applied to this transport. do you mean another protocol in sb?

@APT-ZERO
Copy link

I meant Hy2 too, Have a look at this https://github.com/SagerNet/sing-quic
It seems like Clash.Meta(Mihomo) made improvements to QUIC, and Sing-Box used the same but even optimized it more
Everything they did, must be applicable to Xray too

@Fangliding
Copy link
Member

Fangliding commented Jun 20, 2024

The acceleration method used by hy2 is not applicable to CDN(in fact, I can implement a similar acceleration in TCP, but it is also not used for CDN)
In short, its performance is far from what you imagine

@Fangliding Fangliding closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2024
@RPRX
Copy link
Member

RPRX commented Jun 21, 2024

我觉得可以为了 diversity 而支持 HTTP/3,无论有没有 acceleration,反正饼已经画在 release note 中了

@mmmray
Copy link
Collaborator

mmmray commented Jun 29, 2024

I looked into this yesterday and could not figure out how to make it work with uTLS. I think QUIC without uTLS is a bit pointless, the fingerprint is too severe.

So instead I added splithttp to browser dialer as it was already suggested by RPRX elsewhere: #3484

It seems to me that http3 support in splithttp is a niche feature anyway, those who need it can just open chromium, it's fine. But I still have to test if chromium actually attempts http3 with the current JS. Works!

When looking into this, I also wondered how to deal with the ALPN issue in splithttp, and found that there is a way to solve it perfectly: refraction-networking/utls#74

this PR should probably be revived if we want to fix ALPN. It seems everybody (OONI and SagerNet) is forking net/http instead, but this seems like a massive headache to maintain.

@Fangliding
Copy link
Member

Fangliding commented Jul 16, 2024

I think this could be done soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants