mirror of https://github.com/grpc/grpc-web.git
Merge pull request #136 from stanley-cheung/master
Some scripts and docs cleanup
This commit is contained in:
commit
47517814c6
|
|
@ -0,0 +1,78 @@
|
|||
This document shows you some steps on how you can install gRPC-Web and the
|
||||
necessary pre-requisites.
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
* Ubuntu
|
||||
|
||||
```sh
|
||||
$ sudo apt-get install autoconf automake build-essential curl git \
|
||||
default-jdk default-jre libtool libpcre3 libpcre3-dev libssl-dev \
|
||||
make wget zip
|
||||
```
|
||||
|
||||
* MacOS
|
||||
|
||||
```sh
|
||||
$ brew install autoconf automake libtool pcre
|
||||
```
|
||||
|
||||
## Clone the repo
|
||||
|
||||
```sh
|
||||
$ git clone git@github.com:grpc/grpc-web.git
|
||||
$ cd grpc-web && git submodule update --init
|
||||
|
||||
$ cd third_party/grpc
|
||||
$ git submodule update --init
|
||||
```
|
||||
|
||||
## 1. Install Protobuf
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ cd third_party/grpc/third_party/protobuf
|
||||
$ ./autogen.sh && ./configure && make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
|
||||
## 2. Install gRPC
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ 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
|
||||
```
|
||||
|
||||
## 3. Download the Closure compiler
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ 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.
|
||||
|
||||
|
||||
## Build!
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ make # build the nginx gateway
|
||||
```
|
||||
|
||||
|
||||
For more example on how to build the client and an end-to-end example, please
|
||||
see [this page](net/grpc/gateway/examples/echo).
|
||||
|
|
@ -16,8 +16,8 @@ You need the following 3 things before you start:
|
|||
2. gRPC
|
||||
3. Closure compiler
|
||||
|
||||
Click [here](#pre-requisites) or scroll down to see some details on how to
|
||||
install those.
|
||||
Click [here](../../../../../INSTALL.md) and make sure you have installed all
|
||||
required pre-requisites.
|
||||
|
||||
## Build the example
|
||||
|
||||
|
|
@ -52,71 +52,6 @@ http://<hostname>:8080/net/grpc/gateway/examples/echo/echotest.html
|
|||
```
|
||||
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
* Ubuntu
|
||||
|
||||
```sh
|
||||
$ sudo apt-get install autoconf automake build-essential curl git \
|
||||
default-jdk default-jre libtool libpcre3 libpcre3-dev libssl-dev \
|
||||
make wget zip
|
||||
```
|
||||
|
||||
* MacOS
|
||||
|
||||
```sh
|
||||
$ brew install autoconf automake libtool pcre
|
||||
```
|
||||
|
||||
## Clone the repo
|
||||
|
||||
```sh
|
||||
$ git clone git@github.com:grpc/grpc-web.git
|
||||
$ cd grpc-web && git submodule update --init
|
||||
|
||||
$ cd third_party/grpc
|
||||
$ git submodule update --init
|
||||
```
|
||||
|
||||
## 1. Install Protobuf
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ cd third_party/grpc/third_party/protobuf
|
||||
$ ./autogen.sh && ./configure && make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
|
||||
## 2. Install gRPC
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ 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
|
||||
```
|
||||
|
||||
## 3. Download the Closure compiler
|
||||
|
||||
From the repo root directory:
|
||||
|
||||
```sh
|
||||
$ 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.
|
||||
|
||||
|
||||
|
||||
## What's next?
|
||||
|
||||
For more details about how you can run your own gRPC service from the browser,
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
## Overview
|
||||
|
||||
Provided as a Javascript client library, gRPC Web allows a browser/HTML client
|
||||
to use the same API as a Node client to access a grpc service. While grpc-web
|
||||
speaks a different protocol than the native grpc (over http/2) protocol, the
|
||||
end-to-end semantics is identicial to what a native grpc client (e.g. a Node
|
||||
client) experiences.
|
||||
|
||||
This gRPC Web library supports server streaming and simple unary calls across
|
||||
all major browsers. The client library has proto3 support and uses the
|
||||
protobuf binary format. It also provides a generated code surface for your
|
||||
service stub via a protoc plugin.
|
||||
|
||||
The gRPC Nginx gateway will do the gRPC protocol translation to the backend.
|
||||
It can serve as a reverse proxy for both your HTTP and gRPC traffic.
|
||||
|
||||
## Key features
|
||||
|
||||
* JS library with code generation with Node API and proto3 support
|
||||
* Server streaming and unary calls across all major browsers
|
||||
* Client works over any HTTP versions
|
||||
* Closure-based JS library compilation is supported
|
||||
* Nginx based reverse proxy for both HTTP and gRPC traffic
|
||||
* Cross-origin (CORS) support (without preflight)
|
||||
|
||||
## Status
|
||||
|
||||
Alpha
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
* Protobuf v3.0.0+
|
||||
* gRPC v1.0.0+
|
||||
* Docker (dev dependency)
|
||||
|
||||
## Build the Nginx gateway
|
||||
|
||||
```sh
|
||||
$ ./build.sh
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
Please go to the [examples][] directory to see how you can run a demo service.
|
||||
|
||||
## Known gaps / issues
|
||||
|
||||
* Limited platform/OS support, for the Nginx gateway
|
||||
* No performance or load testing
|
||||
* No client-streaming or bidi-streaming support
|
||||
* Limited documentation
|
||||
* CORS preflight bypass to be added
|
||||
|
||||
[examples]:https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/echo
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
./init_submodules.sh
|
||||
cd ..
|
||||
make clean
|
||||
cd third_party/grpc/third_party/protobuf \
|
||||
&& ./autogen.sh \
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
./init_submodules.sh
|
||||
cd ..
|
||||
make clean
|
||||
docker build -t debian_stretch -f net/grpc/gateway/docker/debian_stretch/Dockerfile .
|
||||
CONTAINER_ID=$(docker create debian_stretch)
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
cd ..
|
||||
git submodule update --init
|
||||
cd third_party/closure-library && git checkout tags/v20160911 -f && cd ../..
|
||||
cd third_party/openssl && git checkout tags/OpenSSL_1_0_2h -f && cd ../..
|
||||
cd third_party/grpc && git checkout 2b0ab320c12cb807cf05b3295b7017d0ccbf66f5 -f && git submodule update --init && cd ../..
|
||||
cd scripts/
|
||||
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
./init_submodules.sh
|
||||
cd ..
|
||||
make clean
|
||||
docker build -t ubuntu_12_04 -f net/grpc/gateway/docker/ubuntu_12_04/Dockerfile .
|
||||
CONTAINER_ID=$(docker create ubuntu_12_04)
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
./init_submodules.sh
|
||||
cd ..
|
||||
make clean
|
||||
docker build -t ubuntu_14_04 -f net/grpc/gateway/docker/ubuntu_14_04/Dockerfile .
|
||||
CONTAINER_ID=$(docker create ubuntu_14_04)
|
||||
Loading…
Reference in New Issue