[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Target proxies for Cloud Service Mesh\n=====================================\n\n| **Note:** This guide only supports Cloud Service Mesh with Google Cloud APIs and does not support Istio APIs. For more information see, [Cloud Service Mesh overview](/service-mesh/docs/overview).\n\nThis document applies only to Cloud Service Mesh with the load balancing APIs. We\nstrongly recommend that you use the\n[service routing APIs](/service-mesh/docs/service-routing/service-routing-overview)\nto deploy Cloud Service Mesh.\n\nWhen you configure Cloud Service Mesh, one of the resources that you configure is the\ntarget proxy. In the context of Cloud Service Mesh, target proxies serve two\nprimary purposes:\n\n- Defining the protocol that Cloud Service Mesh clients use when they\n open a connection to the backends or endpoints associated with a service.\n\n- Working with forwarding rules and URL maps to create a routing rule map. The\n routing rule map provides additional capabilities, such as routing rules,\n depending on the type of target proxy. Invalid selections are either hidden\n in the user interface or rejected by the API.\n\n| **Note:** To configure target TCP proxies, you can only use the Google Cloud CLI or the API.\n\nTarget proxy types and request protocols\n----------------------------------------\n\nCloud Service Mesh generates different configurations for its clients based on\nthe type of target proxy that you configure. When you configure a target\nproxy type, the Cloud Service Mesh client uses a specific request protocol.\n\nYou aren't restricted to choosing only one type. For example, your\napplication might want to use HTTP when addressing some services but use TCP\nwhen addressing other services. For such a use case, you need to create both a\ntarget HTTP proxy and a target TCP proxy.\n\nValid resource combinations in a routing rule map\n-------------------------------------------------\n\nTo avoid misconfigurations, Cloud Service Mesh only lets you create routing rule\nmaps that look like the following:\n\n- Forwarding rule \\\u003e global target HTTPS proxy \\\u003e URL map \\\u003e one or more backend services\n- Forwarding rule \\\u003e global target HTTP proxy \\\u003e URL map \\\u003e one or more backend services\n- Forwarding rule \\\u003e global target gRPC proxy \\\u003e URL map \\\u003e one or more backend services\n- Forwarding rule \\\u003e global target TCP proxy \\\u003e one backend service\n\n| **Note:** Health checks and backends are not shown in the preceding list.\n\nIf you're using the Google Cloud console to set up a target HTTP proxy, the\ntarget proxy is set up implicitly as part of your routing rule map\nconfiguration. TCP proxy setup is not yet supported in the\nGoogle Cloud console.\n\nIf you're using the Google Cloud CLI or the APIs, you need to configure the\ntarget proxy explicitly.\n| **Note:** Target proxies are also used for [certain Google Cloud load\n| balancers](/load-balancing/docs/target-proxies). This page only discusses target proxies in the context of Cloud Service Mesh.\n\nTraffic handling\n----------------\n\nThe following sections describe ways to handle traffic depending on the\ntype of target proxy that you use.\n\n### Using a target HTTP or HTTPS proxy\n\nWhen you configure HTTP- or HTTPS-based services, each service instance\ngenerally has an Envoy proxy deployed alongside it. Cloud Service Mesh configures\nthis Envoy proxy. It is part of your service mesh data plane and handles traffic\nas follows.\n\nThe Envoy proxy receives the outbound request. It then compares the request's\ndestination IP address and port to the IP address and port configured in each\nforwarding rule that references a target HTTP or HTTPS proxy. If a match is\nfound, the Envoy proxy evaluates the request according to the target proxy's\ncorresponding URL map.\n\n### Using a target TCP proxy\n\nWhen you configure TCP-based services, each service instance generally\nhas an Envoy proxy deployed alongside it. Cloud Service Mesh configures\nthis Envoy proxy. It is part of your service mesh data plane and handles traffic\nas follows.\n\nThe Envoy proxy receives the outbound request. It then compares the request's\ndestination IP address and port to the IP address and port configured in each\nforwarding rule that references a target TCP proxy. Each forwarding rule routes\nTCP traffic to a target proxy that points to a default backend service. The\nbackend service specifies a health check and determines the appropriate backend.\n\n### Using a target gRPC proxy\n\nWhen you configure gRPC-based services, your service instances generally don't\nhave Envoy proxies deployed alongside them. Instead, Cloud Service Mesh\nconfigures the gRPC library. The library is part of your service mesh data plane\nand handles traffic as follows.\n\nThe gRPC library compares the `hostname[:port]` specified in the URI to the host\nrules in all URL maps that a target gRPC proxy references. If a match is\nfound, the gRPC library evaluates the request according to the path rules\nassociated with the matching host rule.\n\nTarget proxy resources\n----------------------\n\nTo add, delete, list, and get information about target proxies,\nyou can use the REST API or the gcloud CLI.\n\nIn addition, to get information about a target proxy, you can use the following\n`gcloud` commands: \n\n```\ngcloud compute [target-http-proxies | target-tcp-proxies | target-grpc-proxies] list\n``` \n\n```\ngcloud compute [target-http-proxies | target-tcp-proxies | target-grpc-proxies] describe TARGET_PROXY_NAME\n```\n\n### APIs\n\nFor descriptions of the properties and methods available to you when\nworking with target proxies through the\n[REST API](/compute/docs/reference/rest/v1), see the following\nresources that Cloud Service Mesh supports:\n\n- [TargetHttpsProxies](/compute/docs/reference/v1/targetHttpsProxies)\n- [TargetHttpProxies](/compute/docs/reference/rest/v1/targetHttpProxies)\n- [TargetTcpProxies](/compute/docs/reference/rest/v1/targetTcpProxies)\n- [TargetGrpcProxies](/compute/docs/reference/rest/v1/targetGrpcProxies)\n\n### gcloud CLI\n\nFor the\n[Google Cloud CLI](/sdk/gcloud/reference/compute), see the following resources:\n\n- [target-https-proxies](/sdk/gcloud/reference/compute/target-https-proxies)\n- [target-http-proxies](/sdk/gcloud/reference/compute/target-http-proxies)\n- [target-tcp-proxies](/sdk/gcloud/reference/compute/target-tcp-proxies)\n- [target-grpc-proxies](/sdk/gcloud/reference/compute/target-grpc-proxies)\n\nWhat's next\n-----------\n\n- To learn more about Cloud Service Mesh, see the [Cloud Service Mesh overview](/service-mesh/docs/overview).\n- To deploy Cloud Service Mesh, see the [Guide to Cloud Service Mesh deployment documentation](/service-mesh/legacy/load-balancing-apis/deploy)."]]