go-grpcweb
grpc-web handler for go

About
Translates between grpc-web requests and grpc responses
Simply wrap your grpc server with this handler
Usage
Install
go get github.com/seankhliao/go-grpcweb
Use
import (
"net/http"
"google.golang.org/grpc"
grpcweb "github.com/seankhliao/go-grpcweb"
pb "your-proto-definition"
)
func main(){
svr := grpc.NewServer()
hw.RegisterGreeterServer(svr, &Server{})
handler := grpcweb.New(svr)
http.Handle("/", handler)
http.ListenAndServe(":8080", nil)
}
Todo
- Write tests
- Write better docs (h2c)
- Improve error handling
- investigate closing http2 streams
- Cleanup header parsing / constants
Links