How do I connect to gRPC Server running on Raspberry Pi

Solution 1:

localhost which generally resolves to 127.0.0.1 is a special network address.

It is a way for a host to refer to itself (generally) without using the (full) network stack.

In this case, it appears your gRPC server is only bound to localhost and, as a result, is only accessible to itself from other connections using the localhost address.

This explains why it can talk to itself but why other hosts are unable to access it. NOTE The other hosts using localhost are referring to their own localhost|loopback address.

You will need to reconfigure your gRPC server to bind to a specific network address. Often you can achieve this using 0.0.0.0 instead of localhost (or 127.0.0.1)