This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已动态机器翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
This content has been machine translated dynamically.
This content has been machine translated dynamically.
This content has been machine translated dynamically.
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.
Este artigo foi traduzido automaticamente.
这篇文章已经过机器翻译.放弃
Translation failed!
gRPC with responder policy
带响应程序策略配置的 gRPC 解释了 Citrix ADC 设备如何通过 HTTP/2 协议对 gRPC 请求提供不同的响应。当用户请求网站主页时,您可能希望提供不同的主页,具体取决于每个用户所在的位置或用户使用的浏览器。 下图显示了组件的交互作用。
- 在设备上启用响应程序功能。
- 配置响应程序操作以生成自定义响应、将请求重定向到其他网页或重置连接。
- 配置响应程序策略以确定必须对其采取操作的 gRPC 请求(流量)。
- 将响应程序策略绑定到负载平衡虚拟服务器,以检查流量是否与策略表达式匹配。
- 通过使用响应程序策略,您可以根据 gRPC 状态码执行以下操作。
使用 CLI 使用响应程序策略配置 grPC 呼叫终止
要使用响应程序策略配置 grPC 呼叫终止,您必须完成以下步骤:
- 启用响应程序功能
- 添加响应程序操作
- 添加响应者策略和关联响应者操作
- 绑定响应程序策略以平衡虚拟服务器
启用响应程序功能
要使用响应程序功能,必须首先启用它。
在命令提示窗口中,键入:
enable ns responder
添加响应程序操作
启用该功能后,您必须根据后端服务器返回的状态码配置响应程序操作以处理 gRPC 响应。
在命令提示窗口中,键入:
add responder action <name> <type>
示例:
add responder action grpc-act respondwith "HTTP/1.1 200 OK\r\nServer: NS-Responder\r\nContent-Type:application/grpc\r\ngrpc-status: 12\r\ngrpc-message: Not Implemented\r\n\r\n" + "Method: " + HTTP.REQ.URL+ "is not implemented."
添加响应程序策略
配置响应程序操作后,您必须接下来配置响应程序策略以选择 Citrix ADC 设备必须响应的 gRPC 请求。
在命令提示窗口中,键入:
add responder policy <name> <expression> <action> [<undefaction>]-appFlowaction <actionName>
示例:
add responder policy grpc-resp-pol1 HTTP.REQ.URL.NE(“/helloworld.Greeter/SayHello”) grpc-act
绑定响应程序策略以平衡虚拟服务器
要使策略生效,必须使用 gRPC 服务将其绑定到负载平衡虚拟服务器。
在命令提示窗口中,键入:
bind responder global <policyName> <priority> [<gotoPriorityExpression> [-type <type>] [-invoke (<labelType> <labelName>)]
示例:
bind lb vserver lb-grpc svc-grpc -policyName grpc-resp-pol1 –priority 100
有关响应程序策略的更多信息,请参阅 响应者政策 主题。
分享:
分享:
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select Do Not Agree to exit.