A bridge for @improbable-eng/grpc-web using native gRPC
Based on react-native-grpc from Mitch528, found here.
npm install @matejdr/react-native-grpc-bridge
nvm install
or
nvm use
yarn install
import { grpc } from '@improbable-eng/grpc-web';
import { NativeGRPCTransport } from '@matejdr/react-native-grpc-bridge';
grpc.setDefaultTransport(NativeGRPCTransport({ withCredentials: true }));
There is an envoy proxy in front of go server.
cd server
docker-compose up --build server envoy
You can also run the grpc server manually using the following instructions.
- protoc : link
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/proto
go install github.com/golang/protobuf/protoc-gen-go@latest
export PATH=$HOME/go/bin:$PATH
GROC_WEB_PLUGIN=protoc-gen-grpc-web-1.0.6-darwin-x86_64
curl -OL https://github.com/grpc/grpc-web/releases/download/1.0.6/$GROC_WEB_PLUGIN
sudo mv $GROC_WEB_PLUGIN /usr/local/bin/protoc-gen-grpc-web
chmod +x /usr/local/bin/protoc-gen-grpc-web
protoc \
--proto_path=server/proto \
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
--js_out=import_style=commonjs:example/src/api \
--ts_out=service=grpc-web:example/src/api \
echo.proto
protoc \
--proto_path=server/proto \
--go_out=plugins=grpc:server/echoserver/echo \
--go_opt=paths=source_relative \
echo.proto
cd server/echoserver
go run main.go
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT