SplitHTTP client: Add xmux (multiplex controller) for H3 & H2 (#3613)

https://github.com/XTLS/Xray-core/pull/3613#issuecomment-2351954957

Closes https://github.com/XTLS/Xray-core/issues/3560#issuecomment-2247495778

---------

Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>
This commit is contained in:
ll11l1lIllIl1lll 2024-09-16 12:42:01 +00:00 committed by GitHub
parent a931507dd6
commit b1c6471eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 475 additions and 64 deletions

View file

@ -11,6 +11,7 @@ type splitConn struct {
reader io.ReadCloser
remoteAddr net.Addr
localAddr net.Addr
onClose func()
}
func (c *splitConn) Write(b []byte) (int, error) {
@ -22,6 +23,10 @@ func (c *splitConn) Read(b []byte) (int, error) {
}
func (c *splitConn) Close() error {
if c.onClose != nil {
c.onClose()
}
err := c.writer.Close()
err2 := c.reader.Close()
if err != nil {