Giter Club home page Giter Club logo

grpc-playground's Introduction

gRPC Playgorund

Features

  1. Based on Protocol Buffers and HTTP/2
  2. Supports SSL
  3. Data types: bool, int, float, string, bytes, list, map, structs...
  4. Pre-defined set of error codes
  5. Streaming RPC -- sending multiple messages per channel (uni- or bidirectional)
  6. Multiplexing -- handling multiple channels over one connection
  7. Deadlines and cancels

Python

grpcio library is needed only for file generation not for runtime.

grpclib provides asyncio-compatible gRPC interface for Python.

To re-generate Python definitions run:

python -m grpc_tools.protoc --proto_path=. --python_out=python  --python_grpc_out=python helloworld.proto

To start server run:

python python/server.py localhost <PORT> keys/server.crt keys/server.key keys/client.crt

To start client run:

python python/client.py localhost <PORT> keys/client.crt keys/client.key keys/server.crt

Rust

Available libs:

  1. grpc-rust -- Pure Rust implementation, under development (generally works, but has poor performance). Potentially Tokio-compatible (See this issue).
  2. grpc-rs -- Wrapper for C++, under development (some features are missing, e.g. reflection, custom metadata and authentication) -- this one is used here
  3. tower-grpc -- Pure Rust implementation based on Tower, very immature.

To re-generate Rust definitions install protobuf-codegen and grpcio-compiler and run:

python -m grpc_tools.protoc 
    --proto_path=.
    --rust_out=rust/helloworld/src
    --grpc_out=rust/helloworld/src
    --plugin=protoc-gen-grpc="<PATH_TO_`grpc_rust_plugin`_EXECUTABLE>"
    helloworld.proto

To start server run:

./rust/helloworld/target/debug/server.exe localhost <PORT> keys/server.crt keys/server.key keys/client.crt

To start client run:

./rust/helloworld/target/debug/client.exe localhost <PORT> keys/client.crt keys/client.key keys/server.crt

Other notes

grpc_cli has to be built from sources link

grpc-playground's People

Contributors

wiezzel avatar

Stargazers

Kevin Alexander Scott Jellis avatar

Watchers

 avatar James Cloos avatar Viggith avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.