By kienvtqhi
Hello,
I am trying to deploy a gRPC server to App Platform. But I don’t know how to open the port 50051
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I used postman to connect to gRPC server but it failed.
gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting: SocketException: Failed host lookup: ‘https://orcaxxxx.ondigitalocean.app’ (OS Error: No address associated with hostname, errno = 7)
App Platform only supports HTTP traffic so running a gRPC service that’s publicly available will not work.
It is possible to run a gRPC service internally that is accessible by components within your app using internal service ports.
Hello, thanks for trying App Platform.
To further add to Jon’s answer… there is a more in-depth explanation in this similar question.
For gRPC you would have to add some kind of translation proxy component in front to serve the HTTP traffic, that also translates and routes the requests to the gRPC service backend, which can be an internal service.
Here is a Node.js example of the general idea.
Another option is to utilize grpc-gateway to accomplish this. There are various ways to use the tool, and I suggest you explore the documentation.
If you wish to use Go, there is a benefit here in that you can have a single service that serves both the front HTTP and implements the gRPC handlers and to them.
Or you can also have 2 components as well, but the translation glue code is still a bit more concise and automatic. With two separate services, you can have the backend implemented in whatever language you chose.
Here is a sample repo that implements both of these approaches.
Hope this helps.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.