chore: add early conn interface to decrease unneeded write

This commit is contained in:
wwqgtxx
2023-02-27 00:26:49 +08:00
parent c8c078e78a
commit c1199f1a8a
14 changed files with 144 additions and 62 deletions

View File

@ -430,6 +430,15 @@ func (vc *Conn) Upstream() any {
return vc.tlsConn
}
func (vc *Conn) NeedHandshake() bool {
select {
case <-vc.handshake:
return true
default:
}
return false
}
func (vc *Conn) IsXTLSVisionEnabled() bool {
return vc.addons != nil && vc.addons.Flow == XRV
}