Make a program on a computer reachable at an https address, and change its ports later
Publish a program on a computer at an https address, then change its ports when you
need to.
Before you start
You need:
- A computer in
readystate. - A program inside the computer that listens on the target port, such as
8080. - The CLI installed and signed in, with a selected workspace where you have the admin or editor role.
The examples use the computer demo.
Publish at creation
nevia new demo -p 443:8080443:8080 publishes port 443, which serves the bare address, and forwards it to port
8080 inside the computer. Start the program before you test the URL. While nothing
listens on the target port, the URL answers 503.
Publish or change later
nevia set replaces the whole list of ports:
nevia set demo -p 443:8080Clear all HTTPS ports with none:
nevia set demo -p noneA port change briefly interrupts open connections. Programs keep running.
Use HTTP/2 to the workload
Append /h2 when the program speaks plaintext HTTP/2 (h2c), such as gRPC:
nevia set demo -p 443:50051/h2The platform terminates TLS in both cases. Without /h2, the workload receives HTTP/1.1.
Publish several ports
Separate mappings with commas, or repeat -p:
nevia set demo -p 443:8080,8443:9000Each published port must be unique in the list. Computer ports and URLs lists the allowed ports and mapping limits.
Use the CLI, MCP, or console
CLI
Use the commands above. nevia new and
nevia set document every flag.
MCP
create_computer and update_computer take a ports list. Each entry has
published, target, and an optional protocol (http1 by default, or http2):
{
"workspace": "<workspace>",
"name": "demo",
"ports": [
{ "published": 443, "target": 8080 },
{ "published": 8443, "target": 50051, "protocol": "http2" }
]
}update_computer replaces the whole list. Send "ports": [] to remove HTTPS, or leave
ports out to keep the current list.
To change one mapping, read the current list, edit it, and send every mapping you want to keep. Mappings you leave out are removed.
{
"computer": "<computer>",
"ports": [
{ "published": 443, "target": 8081 }
]
}Console
The computer's detail page shows one public endpoint, the 443 mapping. Use the toggle to turn it on or off, and set its target port and protocol (HTTP/1.1 or h2c).
Mappings on other ports, added with the CLI or MCP, stay in place but the console does not show them.
Verify the result
nevia status demoThe output lists the mapping and the computer's url. Open the URL in a browser to see
your program's response. A 503 means nothing listens on the target port. Start the
program and reload.
Constraints
- Ports change only while the computer is
ready. A sleeping or transitioning computer returns409 invalid_state. Wake it first. - A sleeping computer keeps its URL but does not answer.
- Branching or restoring a checkpoint keeps the port mappings but not the running
programs. The new computer gets a new URL, and its ports answer
503until a program listens again. - Anyone with the address can reach the published port. Nevia adds no authentication.
- A port with no listener answers
503.
Computer ports and URLs has the allowed ports, URL rules and mapping limits. Computer lifecycle states shows what survives each transition. MCP reference covers the tool inputs.