//isL4Proxy Determine whether to use L4 proxy
isL4Proxy Determine whether to use L4 proxy
// isL4Proxy Determine whether to use L4 proxy
func IsL4Proxy(svc *v1.Service) bool {
	if len(svc.Spec.Ports) == 0 {
		return false
	}
	port := svc.Spec.Ports[firstPort]
	switch port.Name {
	case "websocket", "grpc", "https", "tcp":
		return true
	case "http", "udp":
		return false
	default:
		return true
	}
}
func IsL4Proxy ( svc * v1 . Service ) bool { if len ( svc . Spec . Ports ) == 0 { return false } port := svc . Spec . Ports [ firstPort ] switch port . Name { case " " , " " , " " , " " : return true case " " , " " : return false default : return true } }
isL4Proxy Determine whether to use L4 proxy
isL4Proxy Determine whether to use L4 proxy
// In the defination of k8s-Service, we can use Service.Spec.Ports.Name to // indicate whether the Service enables L4 proxy mode. According to our // current L7 mode only support the http protocol. Other 7-layer protocols // are automatically degraded to tcp until supported