Fix: only rule mode need break conn when sni update

This commit is contained in:
Author: littoy
2022-04-15 00:46:07 +08:00
committed by yaling888
parent 6327cf7434
commit 46f7c5e565
3 changed files with 11 additions and 5 deletions

View File

@@ -303,7 +303,7 @@ func handleTCPConn(connCtx C.ConnContext) {
defer cancel()
if MitmOutbound != nil && metadata.Type != C.MITM {
if remoteConn, err1 := MitmOutbound.DialContext(ctx, metadata); err1 == nil {
remoteConn = statistic.NewSniffing(remoteConn, metadata)
remoteConn = statistic.NewSniffing(remoteConn, metadata, nil)
defer func(remoteConn C.Conn) {
_ = remoteConn.Close()
}(remoteConn)