Python implementation of a gRPC Server and Client (based on this repo) with an Envoy that can interact with gRPC web applications.
brew install envoy
pip3 install grpcio-tools
python3 -m grpc_tools.protoc --python_out=protobufs/ --grpc_python_out=protobufs/ -I protos protos/greet.proto
Options Explained
--python_out: Is where you want the autogenerated gRPC protocol buffers code to go
--grpc_python_out: Is where you want the autogenerated gRPC python protocols code to go
-I: Points to the folder where the protos are stored
The last argument is the exact proto file you want to use within the folder identified in the -I argument
If you have gRPC web app that you need to connect to the gRPC server, you will need an Envoy. Current web broswers cannot communicate over http2 so the envoy acts as an intermediatry between http2 and http1.
envoy -c envoy.yaml
Note: Ensure that the your web app connects to the Envoy's port and not the gRPC server's port (in this example the Envoy is on port 1025).
python3 server.py
python3 client.py
npx create-react-app grpc-web-app
cd grpc-web-app
npm install bootstrap react-bootstrap
npm start
Add the following line at the top of src/index.js
import 'bootstrap/dist/css/bootstrap.min.css';