gRPC
Procedure
- Edit the chassis.yaml file to enable the gRPC proxy. By default, the proxy is enabled.
cse: protocols: grpc: listenAddress: 127.0.0.1:40101 http: listenAddress: 127.0.0.1:30101 - Add a customized dialer to adapt to application code.
Assume that the previous code is:
conn,err:=grpc.Dial("10.0.1.1:50051",grpc.WithInsecure(),)The code needs to be modified to://target address is consist of the provider name(in that case "Server") and provider port conn, err := grpc.Dial("Server:50051", grpc.WithInsecure(), grpc.WithDialer(func(addr string, time time.Duration) (net.Conn, error) { //127.0.0.1:40101 is local grpc proxy address return net.DialTimeout("tcp", "127.0.0.1:40101", time) })) - Deploy Mesher and applications.
Last Article: Accessing CSE Through Multi-protocol
Next Article: Accessing Mesher Through Multi-language
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.