HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
grpc-ecosystem
grpc-gateway
Go2016–2025
grpc-ecosystem / grpc-gateway

grpc-gateway

gRPC to JSON proxy generator following the gRPC HTTP spec

26Distinct people
27Mentions
0Explicit recommenders
20KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

gRPC to JSON proxy generator following the gRPC HTTP spec

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year27 dated mentions

Observed mentions: 2016-07-15 04:46:33 UTC to 2025-12-01 19:43:02 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC505
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC606
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC303
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC303
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC303
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
gRPC-Gateway gRPC to JSON proxy generator following the gRPC HTTP spec About The gRPC-Gateway is a plugin of the Google protocol buffers compiler protoc. It reads protobuf service definitions and generates a reverse-proxy server which translates a RESTful HTTP API into gRPC. This server is generated according to the google.api.http annotations in your service definitions. This helps you provide your APIs in both gRPC and RESTful style at the same time. Docs You can read our docs at: https://grpc-ecosystem.github.io/grpc-gateway/ Testimonials We use the gRPC-Gateway to serve millions of API requests per day, and have been since 2018 and through all of that, we have never had any issues with it. - William Mill, Ad Hoc Background gRPC is great -- it generates API clients and server stubs in many programming languages, it is fast, easy-to-use, bandwidth-efficient and its design is combat-proven by Google. However, you might still want to provide a traditional RESTful JSON API as well. Reasons can range from maintaining backward-compatibility, supporting languages or clients that are not well supported by gRPC, to simply maintaining the aesthetics and tooling involved with a RESTful JSON architecture. This project aims to provide that HTTP+JSON interface to your gRPC service. A small amount of configuration in your service to attach HTTP semantics is all that's needed to generate a reverse-proxy with this library. Installation Compile from source The following instructions assume you are using Go Modules for dependency management. Use a tool dependency to track the versions of the following executable packages: For Go 1.24 and later, prefer the tool directive in go.mod described in the "Tracking Tools in go.mod" section. The following blank-import pattern is mainly useful for projects that are not using Go 1.24 yet. // +build tools package tools import ( _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2" _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" _ "google.golang.org/protobuf/cmd/protoc-gen-go" ) Run go mod tidy to resolve the versions. Install by running go install \ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ google.golang.org/protobuf/cmd/protoc-gen-go \ google.golang.org/grpc/cmd/protoc-gen-go-grpc This will place four binaries in your $GOBIN; protoc-gen-grpc-gateway protoc-gen-openapiv2 protoc-gen-go protoc-gen-go-grpc Make sure that your $GOBIN is in your $PATH. If you want to emit OpenAPI 3.1 instead of (or in addition to) Swagger 2.0, install protoc-gen-openapiv3 as well: go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv3 ⚠️ Alpha. protoc-gen-openapiv3 is new and its output is not yet stable — the emitted JSON shape for oneofs, wrappers, enums, and similar constructs may change in response to real-world feedback before the plugin graduates. Don't rely on the exact spec bytes being stable across minor releases; the proto-to-OpenAPI mapping rules are likely to tighten, and tooling-compatibility compromises (documented in the generator source) may be revisited as consumer OpenAPI 3.1 support matures. protoc-gen-openapiv2 is the production-stable option. See OpenAPI 3.1 Output for what it supports and how it differs from protoc-gen-openapiv2. Using the tool Directive in Go 1.24 Starting from Go 1.24, the tool directive in go.mod provides a structured way to track and manage executable dependencies. This replaces the previous workaround of using a separate tools.go file with blank imports. Tracking Tools in go.mod Instead of manually importing tool dependencies in a Go source file, you can now use the tool directive in go.mod to declare the tools your project depends on. For example: module tools go 1.24 tool ( github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 google.golang.org/grpc/cmd/protoc-gen-go-grpc google.golang.org/protobuf/cmd/protoc-gen-go ) Managing Tool Dependencies To add tools to your module, use the -tool flag with go get: go get -tool github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway go get -tool github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 go get -tool google.golang.org/protobuf/cmd/protoc-gen-go go get -tool google.golang.org/grpc/cmd/protoc-gen-go-grpc This automatically updates go.mod, adding the tools under the tool directive along with require statements to ensure version tracking. Install Tools Once the tool dependencies are properly recorded in the go.mod file, simply execute the following command in the root directory of your project: go install tool This will place four binaries in your $GOBIN; protoc-gen-grpc-gateway protoc-gen-openapiv2 protoc-gen-go protoc-gen-go-grpc Make sure that your $GOBIN is in your $PATH. Download the binaries You may alternatively download the binaries from the GitHub releases page. We generate SLSA3 signatures using the OpenSSF's slsa-framework/slsa-github-generator during the release process. To verify a release binary: Install the verification tool from slsa-framework/slsa-verifier#installation. Download the provenance file attestation.intoto.jsonl from the GitHub releases page. Run the verifier: slsa-verifier -artifact-path <the-binary> -provenance attestation.intoto.jsonl -source github.com/grpc-ecosystem/grpc-gateway -tag <the-tag> Alternatively, see the section on remotely managed plugin versions below. Usage 1.Define your gRPC service using protocol buffers your_service.proto: syntax = "proto3"; package your.service.v1; option go_package = "github.com/yourorg/yourprotos/gen/go/your/service/v1"; message StringMessage { string value = 1; } service YourService { rpc Echo(StringMessage) returns (StringMessage) {} } 2. Generate gRPC stubs This
Read the full README on GitHub

What Hacker News says

27 sources
There's no reason you couldn't use gRPC with json as a serialized message format. For example grpc-gateway [0] provides a very effective way of mapping a gRPC concept to HTTP/JSON. The thing is, after moving to gRPC, I've never really felt a desire to move back to JSON. While it may be correct to say "parsing json is fast enough" it's important to note that there's a "for most use cases" after that. Parsing protos is fast enough for even more use cases. You also get streams which are amazing for APIs where you have to sync some large amounts of data (listing large collections from a DB for example) across two services. With gRPC you also have a standardized middleware API that is implemented for "all" languages. The concepts cleanly map across multiple languages and types are mostly solved for you. Adding to that you can easily define som
Read the rest
e conventions for a proto and make amazing libraries for your team. At a previous job I made this: https://github.com/CaperAi/pronto/ Made it super easy to prototype multiple services as if you mock a service backed by memory we could plop it into a DB with zero effort. I think this "gRPC vs X" method of thinking isn't appropriate here because protos are more like a Object.prototype in JavaScript. They're a template for what you're sending. If you have the Message you want to send you can serialize that to JSON or read from JSON or XML or another propriety format and automatically get a host of cool features (pretty printing, serialization to text/binary, sending over the network, etc). [0] - https://github.com/grpc-ecosystem/grpc-gateway
In gRPC for Microservices Communication
I would probably go with gRPC + grpc-gateway[1] instead. Declaring your services and models in proto files, annotating your services with google.api.http to help grpc-gateway scaffold your HTTP base. Then just implement your services from the interface generated by grpc-go. You can even register your gRPC services to grpc-gateway without actually bringing up a gRPC server. You finally end up having your exact data models injected to your service handlers. Thus, you don't have to repeat yourself preparing the groundwork to call into your services. This is mostly the way today services in big OSS projects are exposed outside for consumption in a RESTful style. One exception I know of is sourcegraph/sourcegraph. [1] https://github.com/grpc-ecosystem/grpc-gateway#usage
In REST Servers in Go: Part 1 – standard library
> I think what you describe is the shortcoming of the initial grpc spec. It was for some reason decided to define it on top of features which are barely implemented outside of HTTP/2 and special libraries (especially: Trailers). But it would have been possible to just define things on top of common HTTP semantics. This is what grpc-web now fixes according to my understanding. This is also my understanding (minus the Trailers bit) -- there's stuff like grpc-gateway[0] that I've considered using before so I know there's a mapping (whether it's easy to use is another thing) from grpc to HTTP/1.1 ... > I think even streaming should have been possible with HTTP/1.1. Bodies can be streamed there just fine, if libraries support it (for browsers the issue was up to now that the APIs don't support access to bodies as streams). The only thing I'm
Read the rest
not sure if there is an issue in HTTP/1.1 with request streams still running while the response stream has already finished. For streaming I was thinking mostly of the duplex streams, i.e. what Websockets brought to the table, everything else would be pretty hacky. I suspect that grpc translates to regular browser-ready HTTP/1.1 REST pretty easily (outside of trying to decide how), minus the streaming bit, since you'd have to do some sort of comet/long polling/sse/websockets approach. [0]: https://github.com/grpc-ecosystem/grpc-gateway
In The state of gRPC in the browser
My team has been using gRPC + Improbable's grpc-web [0] + Typescript for a green field project and it has been amazing. - Typing all the way to the frontend. - gRPC/protobuf forces you to describe your interfaces and are self-documenting. - gRPC semantics like error codes and deadlines (if you propagate them through your stack, they're particularly useful - for instance, we cancel database transactions across service boundaries if a request times out). - Performance is great (but we're far from seeing bottlenecks with JSON, it's not the reason we choose gRPC). - We use grpc-gateway which auto-generates a REST proxy for our customers. We sometimes use it for interactive debugging. [1] - Rather than importing database models for our management tools and one-off scripts, using the API is so frictionless that we even use it inside our backend
Read the rest
code and for CLI utilities. The Google API design guide is helpful: https://cloud.google.com/apis/design One piece of advice: Treat your gRPC calls like you would treat a GraphQL resolver - if you squint your eyes, they're very similar concepts. Rather than specifying a GraphQL query, you specify a Field Mask. https://developers.google.com/protocol-buffers/docs/referenc... Happy to answer questions on our experience. [0]: https://github.com/improbable-eng/grpc-web [1]: https://github.com/grpc-ecosystem/grpc-gateway
In The state of gRPC in the browser

Showing the 15 most recent of 27 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.