grpc-web-sample

command module
v0.0.0-...-70256e7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 7 Imported by: 0

README

gRPC-Web Sample

This sample is base on official sample.

[Browser]---<HTTP/2>---[envoy]---<gRPC>---[Server]

I make it a little complex, add some feature below:

  • work on kubernetes
  • add gRPC health check
  • separate envoy route prefix
  • use Vue.js for client
  • build all images by Docker

Try it now!

Please prepare Kubernetes cluster before you do this.

git clone https://github.com/zuiurs/grpc-web-sample.git
kubectl apply -f manifest/base.yaml

Check global IP of envoy, a web proxy.

$ kubectl get -n grpc-web-sample svc
NAME     TYPE           CLUSTER-IP      EXTERNAL-IP    PORT(S)          AGE
client   ClusterIP      10.117.10.187   <none>         8080/TCP         2d2h
envoy    LoadBalancer   10.117.13.18    35.200.18.55   8080:32202/TCP   2d1h <--- this
server   ClusterIP      10.117.9.154    <none>         8080/TCP         2d2h

You can access to the client page.

  • http://[global-ip-of-envoy]:8080/client/index.html

clientimage

Modify it!

Build client and server images. NOTE: You have to change docker repository name in Makefile.

make client
make server

Generate protocol buffers files. This rule have some prerequisite.

  • Install
    • protoc
    • protoc-gen-go
    • protoc-gen-grpc-web
make proto

License

This software is released under the MIT License, see LICENSE.

Author

Mizuki Urushida (@zuiurs)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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