Reference

Computer ports and URLs

Published port rules, mapping syntax, protocols, computer URLs and how each state and lifecycle action affects them

This page lists the exact rules for published ports and the computer url. To publish a port, see Publish a computer on an HTTPS URL. For state names, see Computer lifecycle states.

Port mappings

Each mapping has three fields.

FieldMeaningConstraint
publishedPort on the platform side. Forms the URL.443 or 8000 to 20000. Unique within the list.
targetPort the workload listens on inside the computer.1 to 65535.
protocolHow the platform speaks to the workload.http1 (default) or http2 (h2c).
  • A computer holds at most 16 mappings.
  • A mapping list replaces as a whole. Send the full list to change one mapping.

Shorthand syntax

The CLI accepts this syntax for nevia new -p and nevia set -p. Repeat -p or separate values with commas.

InputPublishedTargetProtocolURL
808080808080http1https://<host>:8080
443:80804438080http1https://<host>
8080/h280808080http2https://<host>:8080
443:3000/h24433000http2https://<host>
nonen/an/an/aClears all mappings (nevia set only)

MCP takes the same fields as objects: {"published": 443, "target": 3000, "protocol": "http2"}. protocol is optional and defaults to http1.

Protocols

ProtocolSpeaks to the workloadUse when
http1HTTP/1.1Default. Web servers and most APIs.
http2HTTP/2 over plaintext (h2c)The workload speaks only HTTP/2, such as gRPC.

TLS ends at the platform in both cases. Clients always connect to https://. The workload never serves TLS. The /h2 suffix and http2 set only the protocol to the workload.

URLs

RuleDetail
Formhttps://<host> for 443. https://<host>:<published> for any other port.
Computer urlSet once, when the computer first becomes ready. It never changes.
Per-mapping urlEach mapping response includes its own url.
Before a hostnameThe mapping url is null until the computer has a hostname.
StabilitySleep and wake keep the url. Branch and checkpoint restore issue a new url.
AuthThe URL has no authentication. Anyone with the address can reach it.

url shows an address, not the current state. A sleeping computer keeps its url but does not answer on it.

Behaviour by state

StateComputer urlPorts
creatingNot yet set.Do not answer.
readySet.Answer when the workload listens on the target. Return 503 when nothing listens.
sleepingKept.Do not answer. Changes are refused with 409 invalid_state.

Behaviour by lifecycle action

ActionURLPortsPrograms
SleepKept.Kept. Do not answer while asleep.Paused in memory. Active exec sessions end.
WakeKept.Kept. Answer again.Resume. Exec sessions do not reconnect.
BranchNew url on a new computer.Same mapping list.Not copied. Ports return 503 until something listens.
Restore a checkpointNew url on a new computer.Same mapping list.Not copied. Ports return 503 until something listens.
Update portsKept.Replaced by the new list. Open connections are interrupted.Keep running.

Port changes require the ready state. A sleeping computer refuses them until you wake it.

Responses

ConditionResponse
Workload listens on the targetForwarded to the workload.
Nothing listens on the target503.
Computer sleepingPort does not answer.
Port change while sleeping, transitioning or otherwise not ready409 invalid_state.

Interfaces

InterfaceSet ports at createChange ports laterNotes
CLInevia new -p <MAPPING>nevia set <COMPUTER> -p <MAPPING>-p is repeatable or comma-separated. none clears. The CLI publishes nothing by default.
MCPcreate_computer with portsupdate_computer with ports[] removes HTTPS. Omit ports to leave the list unchanged.
ConsolePublishes 443 for new computers.Toggle, target port and protocol.Shows one endpoint: the 443 mapping. Mappings on other ports stay in place and do not appear.

Use nevia status <COMPUTER> to read the computer url. See nevia new and nevia set for all flags.

On this page