grpcweb

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 6 Imported by: 0

README

go-grpcweb

grpc-web handler for go

License GoDoc Build

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(next http.Handler) http.Handler

New returns a new http.Handler wrapping the provided handler transforms grpc-web <-> grpc

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL