The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Richard Belleville 0c28a9beaf Specify the Python version 5 years ago
..
README.md Specify the Python version 5 years ago
helloworld_pb2.py Add Python xDS example server 5 years ago
helloworld_pb2_grpc.py Add Python xDS example server 5 years ago
server.py Add Python xDS example server 5 years ago

README.md

gRPC Hostname Example

The hostname example is a Hello World server whose response includes its hostname. It also supports health and reflection services. This makes it a good server to test infrastructure, like load balancing.

The example requires grpc to already be built. You are strongly encouraged to check out a git release tag, since there will already be a build of gRPC available.

Run the example

  1. Navigate to this directory:
cd grpc/examples/python/xds
  1. Run the server
virtualenv venv -p python3
source venv/bin/activate
pip install grpcio protobuf
python server.py
  1. Verify the Server

This step is not strictly necessary, but you can use it as a sanity check if you'd like. If you don't have it, install grpcurl. This will allow you to manually test the service.

Exercise your server's application-layer service:

> grpcurl --plaintext -d '{"name": "you"}' localhost:50051
{
  "message": "Hello you from rbell.svl.corp.google.com!"
}

Make sure that all of your server's services are available via reflection:

> grpcurl --plaintext localhost:50051 list
grpc.health.v1.Health
grpc.reflection.v1alpha.ServerReflection
helloworld.Greeter

Make sure that your services are reporting healthy:

> grpcurl --plaintext -d '{"service": "helloworld.Greeter"}' localhost:50051
grpc.health.v1.Health/Check
{
  "status": "SERVING"
}

> grpcurl --plaintext -d '{"service": ""}' localhost:50051
grpc.health.v1.Health/Check
{
  "status": "SERVING"
}