diff --git a/storage/grpc_client.go b/storage/grpc_client.go index 09fddbdf1f78..df1ada07b55b 100644 --- a/storage/grpc_client.go +++ b/storage/grpc_client.go @@ -27,6 +27,7 @@ import ( storagepb "cloud.google.com/go/storage/internal/apiv2/stubs" "google.golang.org/api/iterator" "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" iampb "google.golang.org/genproto/googleapis/iam/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -88,6 +89,9 @@ func defaultGRPCOptions() []option.ClientOption { option.WithGRPCDialOption(grpc.WithInsecure()), option.WithoutAuthentication(), ) + } else { + // Only enable DirectPath when the emulator is not being targeted. + defaults = append(defaults, internaloption.EnableDirectPath(true)) } return defaults