By Will Belden
Trying to expose a TCP port for a node-red flow for some colleagues. This should be dead simple. The port I’m trying to open is 3333. Port 80 seems to auto-map to the typical http port 1800 and I can access the standard web editor via port 80. I tried this internal_ports you see at the bottom, but that isn’t working:
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
features:
- buildpack-stack=ubuntu-22
ingress:
rules:
- component:
name: nodered-node-red
match:
path:
prefix: /
name: scalesim
region: nyc
services:
- http_port: 8080
image:
registry: nodered
registry_type: DOCKER_HUB
repository: node-red
tag: latest
instance_count: 1
instance_size_slug: basic-xxs
internal_ports:
- 3333
name: nodered-node-red
Can someone advise how I might change this App Spec so that I can test the 3333 TCP port listener in my flow?
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!
Accepted Answer
Hey Will,
I see you’re looking to expose 3333 as TCP port for your Node-RED flow on the DigitalOcean App Platform. Based on the current capabilities of the App Platform, there are a few key points to consider:
The http_port
field in your app specification determines the internal port that your service’s run command listens on. This is typically geared towards HTTP traffic. If you don’t set a PORT
environment variable, the App Platform automatically uses the value of http_port
.
The internal_ports
array you mentioned is intended for internal traffic within your application. These ports are used for communication between services within your app and are not exposed externally. Ports defined in internal_ports
field can accommodate any TCP-based traffic.
For routing external HTTP traffic to your service, you’ll use the ingress
rules in your app spec. This is where you define how HTTP requests are directed to your service components. However, this is specifically for HTTP/HTTPS traffic and not for arbitrary TCP ports.
Given these constraints, if your application requires a direct exposure of a TCP connection on port 3333 that can’t be adapted to HTTP/WebSockets, you might find the App Platform limiting for this specific use case. In this scenario, a DigitalOcean Droplet could be a better fit. Droplets provide more flexibility in terms of network configurations, allowing direct management of TCP ports.
Hope that this helps!
Best,
Bobby
Hi all, Bobby, that is not entirely correct. Opening TCP ports externally on DO Droplets is very challenging (not entirely sure it’s possible in terms of receiving POST requests). I tried for an entire day, and gave up once I realised there were many posts out there saying the same thing. I assume there must be a way, probably support needs to do someting. So fair to say Droplets certainly don’t provide direct management of TCP ports (literally none of the stadard commands work to make a change).
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.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.