Send gRPC requests without authentication

Sends a request without authentication using a gRPC connection.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample


To authenticate to Cloud Run, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

import (

	pb ""

// pingRequest sends a new gRPC ping request to the server configured in the connection.
func pingRequest(conn *grpc.ClientConn, p *pb.Request) (*pb.Response, error) {
	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
	defer cancel()

	client := pb.NewPingServiceClient(conn)
	return client.Send(ctx, p)

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.