Files

Your content root is one flat folder of plain JavaScript, mirrored to the server as-is (to /srv/porthoster). The broker decides what to open purely from the names of the top-level files. This page is the complete set of rules — what counts as an entry point, what is ignored, and what merely rides along.

The layout

~/Developer/LIVE/Port/               content root  →  /srv/porthoster
  echo.tcp.7000.port.js              entry point: TCP :7000
  echo.tcp.7000.port.json            access manifest for the handler beside it
  metrics.udp.9125.port.js           entry point: UDP :9125
  relay.tcp.4000.port.js             entry point: TCP :4000
  lib/                               supporting code — synced, opens no port
    framing.js                         imported by handlers
    codec.js
  _relay.tcp.4001.port.js            ignored: leading _ (local only)
  .git/                              ignored: dotfile
  .notes.md                          ignored: dotfile

Path patterns

PatternRoleSyncedOpens a port
<name>.tcp.<port>.port.js (top level)TCP handler YesYes — TCP on <port>
<name>.udp.<port>.port.js (top level)UDP handler YesYes — UDP on <port>
<name>.<proto>.<port>.port.json (top level) Access manifestYesNo
Any other .js / file / sub-folderSupporting codeYes No — imported, never a listener
A handler-named file not at the top levelSupporting codeYes No — only top-level names are entry points
_* (leading underscore, anywhere)Ignored NoNo
.* (dotfile, anywhere)IgnoredNo No

Naming rules

Ignore rules

Two prefixes are never synced and never opened, so the folder is safe to keep under version control and full of scratch work:

PrefixEffect
_Develop-in-place. _relay.tcp.4001.port.js stays on your machine. Drop the underscore to go live; add it back to take a live port offline.
.Dotfiles — .git, editor state, notes — are left on your machine entirely.

Sidecars & supporting files

Beside a handler you may place a <name>.<proto>.<port>.port.json access manifest — it configures that handler and opens no port of its own. Everything else in the folder — libraries in sub-folders, helper modules, data files — syncs and is importable, but is only ever reached through a handler. Supporting code has no naming rules beyond the ignore prefixes.

Reserved ports

Some ports the broker will not bind, even if you name a handler for them, because they belong to the box itself — the sync API's localhost port and SSH on 22 — or need capability the broker deliberately doesn't hold. A handler that asks for a reserved port is refused and logged rather than opened. The exact reserved set is still being fixed; see Installation → Server (Q7).

See also