mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-01 01:44:15 +00:00
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:
parent
a931507dd6
commit
b1c6471eeb
9 changed files with 475 additions and 64 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue