A Dart gRPC server for flutter_remote_piano
$ dart bin/server.dart -p {port number}
Port 50051 is used as the default if -p
option is omitted.
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.
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.
envoy.Dockerfile
and envoy.yaml
in proxy_example
to your preferred directory.address
on the last line of envoy.yaml may need to be changed depending on your environment.
$ docker build -t piano/envoy -f ./envoy.Dockerfile .
$ docker run -d -p 50051:8080 --name piano_proxy piano/envoy
9090
passed by the -p
flag.
$ dart bin/server.dart -p 9090
You can use some other tools instead as shown in README of gRPC-Web: