I'm having some issues with exposing a gRPC server through ngrok.
I've followed and downloaded the demo code from here.
Connection through localhost is fine, but connecting through ngrok leads me to the following error:
Caught error: gRPC Error (2, HTTP/2 error: Connection error: Connection is being forcefully terminated. (errorCode: 10))
here's the tunnel config I'm using for ngrok in my ~/.ngrok2/ngrok.yml
file:
tunnels:
grpc:
proto: http
addr: 8080
bind_tls: true
region: eu
inspect: true
And this is what I've done so far:
dart bin/server.dart
ngrok grpc
lib/src/client.dart
to use the forwarding
url from ngrokdart bin/client.dart
Though the server is listening on 8080, the client is trying to connect to ngrok's url on standard port 443 for https.
I'm thinking about something with HTTP2 (which gRPC depends on), but according to this ngrok should support it (I'm running version 2.3.35
).
What am I missing or doing wrong?
Turns out ngrok
didn't perform well with the http
option.
Switching to proto:tcp
solved my problem.
I suppose that's because ngrok expects something not provided by gRPC when selecting the proto: http
!