This document shows you how to install gRPC-Web and the necessary pre-requisites.
- Ubuntu
$ sudo apt-get install autoconf automake build-essential curl git \
default-jdk default-jre libtool libpcre3-dev libssl-dev make wget zip
- MacOS
$ brew install autoconf automake libtool pcre
$ git clone https://github.com/grpc/grpc-web
$ cd grpc-web && git submodule update --init
$ cd third_party/grpc
$ git submodule update --init
From the repo root directory:
$ cd third_party/grpc/third_party/protobuf
$ ./autogen.sh && ./configure && make
$ sudo make install
Note: Since gRPC-Web is still in Beta, the version of gRPC required is
sensitive to upstream changes. You most likely will need to build from
the master
branch.
From the repo root directory:
$ cd third_party/grpc
$ EMBED_OPENSSL=false make
$ sudo EMBED_OPENSSL=false make install
# On MacOS Sierra or above, you might need to run these 2 commands instead
# EMBED_OPENSSL=false CPPFLAGS=-DOSATOMIC_USE_INLINED=1 make
# sudo EMBED_OPENSSL=false CPPFLAGS=-DOSATOMIC_USE_INLINED=1 make install
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path-to-repo>/third_party/grpc/libs/opt
From the repo root directory:
$ wget http://dl.google.com/closure-compiler/compiler-latest.zip -O compiler-latest.zip
$ unzip -p -qq -o compiler-latest.zip *.jar > closure-compiler.jar
Make sure closure-compiler.jar
is put in the repo root directory after the
above steps.
From the repo root directory:
$ make # build the nginx gateway
For more example on how to build the client and an end-to-end example, please see this page.