SplitHTTP: Client supports HTTP/3 (#3543)

Closes https://github.com/XTLS/Xray-core/issues/3456

Co-authored-by: Fangliding <Fangliding.fshxy@outlook.com>
Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>
This commit is contained in:
ll11l1lIllIl1lll 2024-07-17 12:10:48 +00:00 committed by mmmray
parent 02cd3b8c74
commit c40fc44a34
4 changed files with 36 additions and 8 deletions

View file

@ -32,6 +32,7 @@ type DefaultDialerClient struct {
download *http.Client
upload *http.Client
isH2 bool
isH3 bool
// pool of net.Conn, created using dialUploadConn
uploadRawPool *sync.Pool
dialUploadConn func(ctxInner context.Context) (net.Conn, error)
@ -118,7 +119,7 @@ func (c *DefaultDialerClient) SendUploadRequest(ctx context.Context, url string,
}
req.Header = c.transportConfig.GetRequestHeader()
if c.isH2 {
if c.isH2 || c.isH3 {
resp, err := c.upload.Do(req)
if err != nil {
return err