Giter Site home page Giter Site logo

andrefedev / grpc_demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dnys1/grpc_demo

0.0 0.0 0.0 368 KB

gRPC implemented with Go server and Flutter client

Kotlin 0.20% Swift 0.65% Objective-C 0.06% Dart 85.18% HTML 1.79% Shell 0.39% Go 5.89% Dockerfile 0.61% Ruby 5.23%

grpc_demo's Introduction

gRPC Demo

Demonstration of the gRPC protocol with a Go server and a Flutter client.

Why gRPC?

gRPC is an alternative to HTTP-JSON which sends structured binary data over HTTP/2 instead of plaintext JSON, resulting in performance increases and more portable models. This is accomplished through the use of Protocol Buffers for model development.

gRPC

Running the Demo

Start Server

To start the server:

docker-compose up

This will launch the gRPC server as well as the Envoy proxy required to run the demo on Flutter Web (explained below).

Start Client

To start the client:

cd client && flutter run

Running on a Device

In order to run the Flutter demo on a device (instead of a simulator), you must use ngrok to tunnel the TCP traffic (requires a free ngrok account).

ngrok tcp 50051

ngrok output

After running this command, you'll need to copy the Forwarding address to client/lib/core/config/config.dart (lines 13 and 24). For Flutter Web, the port is always 8080 because its traffic is routed through the Envoy proxy.

Running on the Web

In order to use gRPC on the web, the grpc-web library is used. Currently, only unary and server-side streaming are supported. Moreover, an intermediate proxy is required to convert HTTP/2 requests and responses to HTTP/1 for the browser. For more information, see this blog post.

grpc-web

grpc_demo's People

Contributors

dnys1 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.