Question

App Platform Worker Incoming Request

We have a nest backend that we host on app platform, the app is using puppeteer cluster that we want to offload from the main backend to a microservice based node server, for this workload app platform workers just look like the perfect choice but the documentation mentions this: Job and worker components can only send outbound requests to other service components and the internet but cannot receive requests. You cannot customize ports for these types of components.

I am not sure if that means workers cannot accept incoming connection? we wanted to use it as a socket connection from our main application, can anyone confirm that we can’t use it for the said purpose?

I would appreciate if someone can propose us a better solution? we don’t want to expose the service publicly


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi Usman,

You’re correct in your understanding. In DigitalOcean’s App Platform, worker components are designed to perform background tasks and can only initiate outbound requests; they cannot accept incoming connections or listen on a specific port.

This means you wouldn’t be able to use an App Platform worker for socket connections as you described.

What you could do instead is:

  1. App Platform Service Component: Another option is to use a service component on App Platform instead of a worker. Service components can accept incoming HTTP requests, and you can secure them by implementing access control within your application.

  2. Use a Private Droplet: One approach is to deploy your microservice on a DigitalOcean Droplet instead of an App Platform worker. That way you will have more control over the exact configuration that you need as with Droplets you have root access to the server itself.

  3. Use a Kubernetes Cluster: If you’re looking for scalability and isolation, you could consider deploying the microservice in a Kubernetes cluster using the DigitalOcean managed Kubernetes service. This way, you can configure internal services within the cluster that your main application can access, without exposing them publicly.

I hope this helps! Let me know if you have any other questions.

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.