blitz.cloudPricing
EnglishEN
Sign inPut your app onlineStart

TCP ports for apps that don't speak HTTP on blitz.cloud

Open a raw TCP port on a blitz.cloud app, for an MQTT broker, a game server or anything else that doesn't use HTTP. An experimental Pro feature: how it works and what to watch out for.

Updated

Every app on blitz.cloud gets an HTTPS address. Some apps need something else, like an MQTT broker that sensors send readings to, or a game server. For those, Pro can open raw TCP ports. Your app listens on its own port, for example 1883, and devices connect to an address like tcp.prod.page:30007.

TCP ports are experimental. We may change how they work or take them away again, so don't build something on them that you can't move elsewhere.

Open a port

  1. Open the app in the dashboard and go to Settings, Advanced.
  2. Under TCP ports, click "Open a port".
  3. Type the port your app listens on inside its container, for example 1883 for MQTT, and click "Open it".

You get a public address like tcp.prod.page:30007 right away, and it works within about a minute. The public number stays the same for as long as the port is open, so a device you set up once keeps working. Each port leads to one port in one app. Pro opens up to 5 ports across all your apps, and Business up to 20. The free plan has none.

Use the name, not the IP address

tcp.prod.page points at several of our servers, and which ones changes when we add or remove servers. Set your devices up with the name and the port, never with an IP address you looked up once. Any of the servers behind the name forwards the connection to your app.

When a server goes away, the connections it carried drop. Most MQTT clients reconnect on their own within seconds. If yours doesn't, switch on its automatic reconnect.

What changes for the app

  • It never sleeps. Connections on a TCP port don't count as visits, so an app with an open port stays awake for as long as the port is open.
  • There's no HTTPS in front of it. We pass the connection to your app as it comes. If the data matters, use the encrypted variant of your protocol, like MQTT over TLS on its own port, with the app's own certificate.
  • It's open to the whole internet. Anybody who finds the port can try to connect. Turn on the app's own sign-in: device tokens, a username and password, or client certificates.
  • Only the app's main part takes TCP. In an app made of several parts, the other parts are reached from inside your account.

When Pro ends

The port keeps its number, but stops leading to the app and the app can sleep again. When you take Pro again, the same address works again. Closing a port retires its number: nobody else gets it for 90 days, and if you open the port again it gets a new one.

The port your app answers its address on can't be opened as a TCP port, so a private app or one behind a sign-in stays that way.

Example: an MQTT broker for ThingsBoard

We ran ThingsBoard 4.3 with its MQTT transport under the same sandbox apps get. It needs the 1 GB size, a PostgreSQL database and about four minutes to start. Open port 1883 on it, and send telemetry with any MQTT client:

mosquitto_pub -h tcp.prod.page -p 30007 -u <device token> -t v1/devices/me/telemetry -m '{"temperature":21.5}'

ThingsBoard 4.4 and newer use a different license, with limits for unlicensed installs. Read it before you put a newer version into production.

Keep your app awake.

On Pro an app answers at any hour, so schedules run on time and webhooks arrive straight away. 7 EUR a month for all your apps. Cancel any time, and you get the first month back if it isn't for you.