简介
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/