From a7a27bad6ea4b4a17587dce6413de1104576d399 Mon Sep 17 00:00:00 2001 From: Khurram Baig Date: Wed, 21 Feb 2024 00:01:26 +0530 Subject: [PATCH] Disable Proxy for Rest to GRPC communication This is internal communication and proxy isn't needed. Also, GRPC is HTTP/2 and using proxy can cause problem as some of the proxies are HTTP/1.1. --- cmd/api/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/api/main.go b/cmd/api/main.go index a2e6bdb5f..a5ca3d7cd 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -217,7 +217,7 @@ func main() { } // Setup gRPC gateway to proxy request to gRPC health checks - clientConn, err := grpc.Dial(":"+serverConfig.SERVER_PORT, grpc.WithTransportCredentials(creds)) + clientConn, err := grpc.Dial(":"+serverConfig.SERVER_PORT, grpc.WithTransportCredentials(creds), grpc.WithNoProxy()) if err != nil { log.Fatalf("Error dialing gRPC endpoint: %v", err) } @@ -231,6 +231,7 @@ func main() { opts := []grpc.DialOption{ grpc.WithTransportCredentials(creds), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100 * 1024 * 1024)), + grpc.WithNoProxy(), } // Register gRPC server endpoint to gRPC gateway