Skip to content

Commit

Permalink
Disable Proxy for Rest to GRPC communication
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
khrm authored and tekton-robot committed Mar 18, 2024
1 parent b6a131b commit a7a27ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand Down

0 comments on commit a7a27ba

Please sign in to comment.