Skip to content

Sample gRPC client & server implemented in Rust

Notifications You must be signed in to change notification settings

GyulyVGC/grpc-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample gRPC client & server in Rust

This is a simple example to illustrate how to implement a gRPC client and server in Rust.

The protobuf file proto/helloworld.proto defines a simple service with one method, SayHello, which takes a HelloRequest and returns a HelloReply.
The build script build.rs generates the needed Rust code from the protobuf file.

The server (src/bin/server) listens on port 50051 and the client (src/bin/client) sends a request to the server waiting for a reply.

Usage

First, you need to run the server:

cargo run --bin server

Then, you can run the client:

cargo run --bin client <name>

About

Sample gRPC client & server implemented in Rust

Topics

Resources

Stars

Watchers

Forks

Languages