Example of using grpc-gateway
and httputil.ReverseProxy
to migrate a service to Go and gRPC by automatically proxying requests for unimplemented methods to the old service.
- Go 1.12+ (https://golang.org/dl/)
- Node 10+ (https://nodejs.org/en/download/)
protoc
3.7.0+ (https://github.com/protocolbuffers/protobuf/releases)protoc-gen-go
(go get -u github.com/golang/protobuf/protoc-gen-go)protoc-gen-grpc-gateway
(go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway)
$ cd node
$ npm install
$ npm start
$ cd go
$ go run main.go
- Modify
node/index.js
.
- Modify
go/hello/hello.proto
. - In
go/hello
, rungo generate
. - Implement handler in
go/main.go
.