Need help with grpc-proxy?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

628 Stars 143 Forks Apache License 2.0 25 Commits 24 Opened issues


gRPC proxy is a Go reverse proxy that allows for rich routing of gRPC calls with minimum overhead.

Services available


Need anything else?

Contributors list

# 301,551
1 commit
# 166,081
React N...
1 commit

gRPC Proxy

Travis Build Go Report Card GoDoc Apache 2.0 License

gRPC Go Proxy server

Project Goal

Build a transparent reverse proxy for gRPC targets that will make it easy to expose gRPC services over the internet. This includes: * no needed knowledge of the semantics of requests exchanged in the call (independent rollouts) * easy, declarative definition of backends and their mappings to frontends * simple round-robin load balancing of inbound requests from a single connection to multiple backends

The project now exists as a proof of concept, with the key piece being the

package that is a generic gRPC reverse proxy handler.

Proxy Handler

The package

contains a generic gRPC reverse proxy handler that allows a gRPC server to not know about registered handlers or their data types. Please consult the docs, here's an exaple usage.

Defining a

that decides where (if at all) to send the request
director = func(ctx context.Context, fullMethodName string) (*grpc.ClientConn, error) {
    // Make sure we never forward internal services.
    if strings.HasPrefix(fullMethodName, "/com.example.internal.") {
        return nil, grpc.Errorf(codes.Unimplemented, "Unknown method")
    md, ok := metadata.FromContext(ctx)
    if ok {
        // Decide on which backend to dial
        if val, exists := md[":authority"]; exists && val[0] == "" {
            // Make sure we use DialContext so the dialing can be cancelled/time out together with the context.
            return grpc.DialContext(ctx, "api-service.staging.svc.local", grpc.WithCodec(proxy.Codec()))
        } else if val, exists := md[":authority"]; exists && val[0] == "" {
            return grpc.DialContext(ctx, "", grpc.WithCodec(proxy.Codec()))
    return nil, grpc.Errorf(codes.Unimplemented, "Unknown method")
Then you need to register it with a
. The server may have other handlers that will be served locally:
server := grpc.NewServer(
pb_test.RegisterTestServiceServer(server, &testImpl{})


is released under the Apache 2.0 license. See LICENSE.txt.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.