Fix vless tests

This commit is contained in:
世界
2023-03-02 00:31:56 +08:00
parent 6e22c004f6
commit e8802357e1
5 changed files with 14 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ func (s *Service[T]) NewConnection(ctx context.Context, conn net.Conn, metadata
userFlow := s.userFlow[user]
if request.Flow != userFlow {
return E.New("flow mismatch: expected ", userFlow, ", but got ", request.Flow)
return E.New("flow mismatch: expected ", flowName(userFlow), ", but got ", flowName(request.Flow))
}
protocolConn := conn
@@ -94,6 +94,13 @@ func (s *Service[T]) NewConnection(ctx context.Context, conn net.Conn, metadata
}
}
func flowName(value string) string {
if value == "" {
return "none"
}
return value
}
type serverConn struct {
net.Conn
responseWriter io.Writer