Compare side-by-side the request speed of grpc-web vs normal rest requests
Install:
- protoc-gen-grpc-web
- Note: you can also globally install it through node with
npm i -g protoc-gen-grpc-weband run the same commands
- Note: you can also globally install it through node with
- protoc
- protobuf-javascript
Ensure that all of these are findable in the PATH
For Windows users, it is recommended to use WSL/WSL2 for compilation due to missing libraries in the current version github issue
Run the CompileProtos.sh file and enter the inputs to generate the client files
-
Open three terminals
- One for the client
- One for the rest-server
- One for the grpc-server
-
Run the grpc-server along with the envoy proxy with the commands:
# Envoy proxy
docker run -d -v "$(pwd)"/envoy.yaml:/etc/envoy/envoy.yaml:ro \
-p 8080:8080 -p 9901:9901 envoyproxy/envoy:v1.22.0
# Server
node index.js
-
Run the rest-server with
node index.js -
Run the react app with
npm run start -
Have fun!