grpc-web-go-client

module
v0.0.0-...-4ef8078 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT

README

gRPC Web Go client

GoDoc GitHub Actions

Easy to use, compatibles with generated client by protoc-gen-go-grpc.
Stream, grpc-web-text is not supported now.
This is fork of https://github.com/ktr0731/grpc-web-go-client

Usage: (full example: examples/main.go)

dial, _ := grpcweb.Dial(addr, grpcweb.WithInsecure())
client := helloworld.NewGreeterClient(dial) // compatible with normal grpc-go code!
res, _ := client.SayHello(context.Background(), &helloworld.HelloRequest{Name: "hello"})
How to run on your machine

Common environment variables.

export ENVOY_ADMIN_PORT=8001 
export GRPC_PORT=8002 
export GRPC_WEB_PORT=8003

Run the following in another terminal.

ENVOY_CONFIG=$(envsubst < examples/envoy.envsubst.yaml) &&  envoy --config-yaml $ENVOY_CONFIG
go run examples/server/main.go
go run examples/main.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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