Documentation
¶
Overview ¶
Command grpcecho is a gRPC server and client for the end-to-end tests of gRPC streams (#315, #317). The service, inkwall.test.Echo, has no .proto: its messages are google.protobuf.StringValue (field 1, text).
- Collect, a client stream: the server reads every message, and answers how many it got.
- Chat, a bidirectional call: the server echoes each message as it comes; the client waits for each echo before it sends the next, so a proxy that holds the call until the client ends its side stalls it.
- Stream, a server stream: the server sends the request's text split at "|", one message each; a part "status:TEXT" ends the call there with status INTERNAL and TEXT as its message (before any message: a trailers-only answer).
The server logs each message it gets ("got: TEXT"), so a test can tell a message never reached it.
grpcecho serve -listen :50051 grpcecho collect -authority grpc.example.com 127.0.0.1:8080 hello world "1' OR '1'='1' -- " grpcecho chat -authority grpc.example.com 127.0.0.1:8080 hello world grpcecho stream -authority grpc.example.com 127.0.0.1:8080 'hello|world'
A client prints the messages it got back, one per line, then the call's status code (OK, PermissionDenied, ...).