chore: support splice for direct outbound

This commit is contained in:
wwqgtxx
2023-04-25 23:01:05 +08:00
parent efcb278f61
commit 7bb5da3005
10 changed files with 76 additions and 9 deletions

View File

@ -113,6 +113,14 @@ func (c *tfoConn) NeedHandshake() bool {
return c.Conn == nil
}
func (c *tfoConn) ReaderReplaceable() bool {
return c.Conn != nil
}
func (c *tfoConn) WriterReplaceable() bool {
return c.Conn != nil
}
func dialTFO(ctx context.Context, netDialer net.Dialer, network, address string) (net.Conn, error) {
ctx, cancel := context.WithCancel(ctx)
dialer := tfo.Dialer{Dialer: netDialer, DisableTFO: false}