Access to gRPC server from outside

Hello guys,

last days i was trying to connect to my gRPC server - from outside.

The server is implemented in nodejs and utilizes following packages :
“express”: “^4.17.2”,
@grpc/grpc-js”: “^1.5.3”,
“google-protobuf”: “^3.19.4”.

Two client apps were implemented:

  • one within the project (on Glitch) using JavaScript,

  • and another one as external application (outside from Glitch) using C#.

The problem is, that the external client app is unable to connect gRPC server.

I tried to use several targets in external client app (for example) :

myproject.glitch.me:PORT

dns:///myproject.glitch.me:PORT

But without success.
Each time I get the message : 14 UNAVAILABLE: Name resolution failed for target dns

If a client is implemented within my Glitch project, then the gRPC communication works well.
But its target is set to :

dns:///localhost:PORT

However, it is impossible to use the same target in external client app, beacuse it’s running out of the Glitch.

Is there any solution?
Does Glitch support external access to the gRPC server from outside?

Many thanks for your answers.

I never realized that this isn’t very prominently stated somewhere in the knowledge base, but your project doesn’t get a public IP address. It runs in a container with mostly isolated networking. You can make outbound connections from inside the container just fine, but all incoming connections aren’t routable. Instead, there’s a giant reverse proxy that Glitch operates, and it takes HTTP and HTTPS connections and forwards them to the container (stripping the TLS in the case of HTTPS; connections to the project containers are all done over plain HTTP) at a port like 3000 or something.

So two things:

  1. When you connect from outside, you’d connect to myroject.glitch.me on port 80 or 443 (depending on whether you’re connecting with TLS).
  2. I don’t know if Glitch’s various proxying supports all the exotic HTTP/2.0 stuff that gRPC needs.
4 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.