Skip to content

A Dart gRPC server for flutter_remote_piano

License

Notifications You must be signed in to change notification settings

kaboc/piano_server

Repository files navigation

gRPC server for Remote Piano

Usage

$ dart bin/server.dart -p {port number}

Port 50051 is used as the default if -p option is omitted.

For gRPC-Web

The web version of Remote Piano uses gRPC-Web instead of grpc-dart. gRPC-Web does not directly connect to a server but to a proxy before a server.

How to set up a proxy (Envoy)

The following settings set up a Docker container with a proxy in it that listens on the port 50051 of the host machine and proxies to the port 9090, which the server should listen on.

  1. Copy envoy.Dockerfile and envoy.yaml in proxy_example to your preferred directory.
  2. The value of address on the last line of envoy.yaml may need to be changed depending on your environment. See the README of gRPC-Web's helloworld for more information.
  3. Build a Docker image by running the following command in the folder where envoy.Dockerfile is located.
$ docker build -t piano/envoy -f ./envoy.Dockerfile .
  1. Create a container and start it with the command below. If necessary, change 50051 to another port you want the proxy to listen on.
$ docker run -d -p 50051:8080 --name piano_proxy piano/envoy
  1. Move back to the root folder of this example and start a server with the port number 9090 passed by the -p flag. Change the number accordingly if you have specified a different one on the last line of your envoy.yaml.
$ dart bin/server.dart -p 9090

Other options for a proxy

You can use some other tools instead as shown in README of gRPC-Web:

Links

About

A Dart gRPC server for flutter_remote_piano

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published