簡介
grpcui通過web的方式對grpc進行調試,類似於postman對http接口的調試。
安裝
官網:https://github.com/fullstorydev/grpcui
go get github.com/fullstorydev/grpcui
go install github.com/fullstorydev/grpcui/cmd/grpcui
苦於沒有翻牆,所以沒能一步到位,手動下載部分依賴,記錄如下:
//安裝go環境
yum install go
mkdir gopath
export GOPATH=/home/xiaofeng/gopath/
//go get 安裝部分
export GOPROXY=https://mirrors.aliyun.com/goproxy/
go get github.com/golang/protobuf
go get github.com/fullstorydev/grpcui
//git clone安裝部分
cd github.com/envoyproxy
git clone https://github.com/envoyproxy/go-control-plane.git
mkdir golang.org/x -p
cd golang.org/x
git clone https://github.com/golang/net.git
git clone https://github.com/golang/text.git
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/oauth2.git
mkdir google.golang.org
cd google.golang.org/
git clone https://github.com/protocolbuffers/protobuf-go.git
mv protobuf-go protobuf
git clone https://github.com/googleapis/go-genproto.git
mv go-genproto/ genproto
git clone https://github.com/grpc/grpc-go.git
mv grpc-go/ grpc
mkdir cloud.google.com
cd cloud.google.com/
git clone https://github.com/googleapis/google-cloud-go.git
mv google-cloud-go/ go
使用
//連接本地的50051grpc服務端口,綁定192.168.13.38建立grpcui的訪問端口(隨機)
#grpcui -bind 192.168.13.38 -plaintext 127.0.0.1:50051
gRPC Web UI available at http://192.168.13.38:38075/
note:注意關閉防火牆
systemctl disable firewalld
瀏覽器訪問
http://192.168.13.38:38075/