Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1006 Bytes

README.md

File metadata and controls

46 lines (36 loc) · 1006 Bytes

Echo

A simple echo server implemented using the gRPC framework.

Running locally

Start the server

go run echo_server/main.go

Run the client

go run echo_client/main.go

Or build the client and run commands

go build -o echo-cli echo_client/main.go
./echo-cli
./echo-cli -input foo

Other commands

Generate code from protocol buffer:

protoc --go_out=. --go_opt=paths=source_relative \
    --go-grpc_out=. --go-grpc_opt=paths=source_relative \
    echo/echo.proto

Query with grpcurl

cd echo
grpcurl -plaintext -proto ./echo.proto 127.0.0.1:50051 list
grpcurl -plaintext -proto ./echo.proto 127.0.0.1:50051 EchoService.Echo
grpcurl -d '{"input": "bar"}' -plaintext -proto ./echo.proto 127.0.0.1:50051 EchoService.Echo

Check with grpcui

cd echo
grpcui -plaintext -proto echo.proto 127.0.0.1:50051