# Services that are not websites

Run a game server, a message broker or your own protocol, and reach it on a port the platform lends you.

Not everything speaks HTTP. A game server, an MQTT broker, a service with its own binary protocol — none of them are web applications, and none of them can be reached by hostname, because a raw connection carries no hostname to route on.

For those, the platform serves a port on **its own** address and forwards the connection to your service:

```
nesly tcp enable --port 25565
```

`--port` is the port your service listens on_inside_ the container. The command prints the address your players or clients connect to.

## The port is lent, not yours

The address belongs to the platform. Your project is lent one port on it, and that matters in three ways worth knowing before you publish it:

-   It **stays the same** while the service is enabled, so you can publish it.
-   It is **returned** when you disable the service, and enabling again may give you a different one. Read the address from `nesly tcp` rather than assuming the old one.
-   It can be **taken back**. You are not given an IP address of your own, and nothing about your project is reachable except through this one port.

## What it costs, and why it is a paid feature

A web application can sleep. When no one is visiting, it stops, and the first request after that wakes it — which is why the free plan can be generous about them.

A service on its own protocol cannot do that. There is no request to hold while it wakes, so it runs continuously and occupies its share of a machine the whole time. That is a real cost, so it is part of a paid plan rather than something anyone can switch on.

## One or the other

A project is either a web application or a service on its own protocol. Turning this on withdraws the project's web addresses, because they would answer visitors with whatever your protocol says to a request it cannot read. If you need both, use two projects.

## Connecting to your database

This is not the way to reach your own database from your laptop — `nesly proxy` already does that, signed in as you, scoped to the project, and open only while the command runs. A database on a public port is a step backwards from that. See [addons](/docs/addons/).

## Commands

```
nesly tcp                       # show the current address
nesly tcp enable --port 1883    # serve the service on a lent port
nesly tcp disable               # stop, and return the port
```

If the command says the service is running but no address has been published yet, the installation you are on has not opened its edge ports. That is an operator task; nothing you can change from here.

---
Canonical: https://nesly.net/docs/tcp/
Markdown: Accept: text/markdown on the HTML URL, or replace the trailing slash with .md
