mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 21:51:23 +08:00
23 lines
559 B
Go
23 lines
559 B
Go
|
package net
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net"
|
||
|
|
||
|
"github.com/sagernet/sing/common/bufio"
|
||
|
"github.com/sagernet/sing/common/network"
|
||
|
)
|
||
|
|
||
|
var NewExtendedConn = bufio.NewExtendedConn
|
||
|
var NewExtendedWriter = bufio.NewExtendedWriter
|
||
|
var NewExtendedReader = bufio.NewExtendedReader
|
||
|
|
||
|
type ExtendedConn = network.ExtendedConn
|
||
|
type ExtendedWriter = network.ExtendedWriter
|
||
|
type ExtendedReader = network.ExtendedReader
|
||
|
|
||
|
// Relay copies between left and right bidirectionally.
|
||
|
func Relay(leftConn, rightConn net.Conn) {
|
||
|
_ = bufio.CopyConn(context.TODO(), leftConn, rightConn)
|
||
|
}
|