Pages

Transports

Reference for the four listeners and the terminal probe that follows every connect. All listeners run in one process and hand callers to the same node manager, so a caller on telnet and a caller in the browser share one board.

The web terminal

Listeners and addresses

ServersConfig.php, filled from the environment by app/Config/servers.config.php:

Listener Env variable Default serve flag
Telnet TELNET_ADDRESS 0.0.0.0:2323 --telnet=
SSH SSH_ADDRESS 0.0.0.0:2222 --ssh=
RLogin RLOGIN_ADDRESS 0.0.0.0:2513 --rlogin=
Web (HTTP + websocket) WEB_ADDRESS 0.0.0.0:8080 --web=

off as the env value disables a listener. On the command line off, no, false and 0 do. A flag overrides the env value for that run:

php carrier serve --telnet=0.0.0.0:23 --rlogin=off

--quiet logs to the log file only. serve stops on SIGINT or SIGTERM. Source: ServeCommand.php, ServerManager.php. Run it under a supervisor; see deployment.

Other ServersConfig fields:

Field Default Meaning
sshGuestUsers ['new', 'guest', 'bbs'] SSH user names let in without a password
sshBanner '' in the class; the board sets "Welcome! Log in with your BBS handle and password, or as "new" to apply." sent before SSH authentication

Telnet

TelnetConnection.php.

On connect the server sends, in one write:

Sent Meaning
WILL ECHO the server echoes; the client stops local echo
WILL SGA, DO SGA character mode, no go-ahead
WILL BINARY, DO BINARY 8-bit clean both ways (CP437 art)
DO TTYPE asks for the terminal type
DO NAWS asks for the window size
Option Server side (DO accepted) Client side (WILL accepted)
ECHO yes —
SGA yes yes
BINARY yes yes
TTYPE — yes: answered with SB TTYPE SEND
NAWS — yes: every SB NAWS resizes the session
NEW-ENVIRON — accepted; its contents are not read

Anything else is refused with WONT / DONT. The terminal type from TTYPE IS is lowercased and becomes TerminalInfo::$type, which picks the colour mode.

The server waits up to one second for both TTYPE and NAWS answers, then carries on.

Raw TCP fallback. If the client sends no telnet command in that second (nc, a raw-socket client), the session's terminal type becomes raw and output is no longer IAC-escaped. Telnet clients get 0xFF doubled as usual.

SSH

A pure-PHP SSH-2 server: SshConnection.php, PacketCipher.php, HostKeys.php. Version string SSH-2.0-Carrier_BBS.

Algorithms

Offered in this order:

Kind Algorithms
Key exchange curve25519-sha256, curve25519-sha256@libssh.org, diffie-hellman-group14-sha256, plus kex-strict-s-v00@openssh.com on the first exchange
Host key ssh-ed25519, rsa-sha2-512, rsa-sha2-256 (the RSA ones only when an RSA key exists)
Cipher aes256-gcm@openssh.com, aes128-gcm@openssh.com, aes256-ctr, aes192-ctr, aes128-ctr
MAC (CTR ciphers) hmac-sha2-256, hmac-sha2-512, hmac-sha1
Compression none

curve25519 uses ext-sodium, group14 uses ext-gmp, ciphers and MACs use ext-openssl.

Strict KEX. When the client offers kex-strict-c-v00@openssh.com on the first exchange, the server enforces OpenSSH's strict key exchange, the fix for Terrapin (CVE-2023-48795). Client-initiated re-keys are supported.

Host keys

Stored in storage/keys/:

File Key
ssh_host_ed25519 Ed25519 secret key, base64
ssh_host_rsa.pem RSA 3072 private key, PEM

Both are created with mode 0600 on the first start when ssh_host_ed25519 is missing. To create them ahead of time and print the fingerprints:

php carrier ssh:keygen
ED25519  …  SHA256:LSZ5zqmB6djzCtHRzFqhy2cqHJ0t5CR0LCAWWnsS24k
RSA  …  SHA256:W0ej4vS4bVhKyahCLLfMbpjmIVwsrDOofjQTMTv6d6Q

--force replaces existing keys; callers will see a host-key-changed warning.

Authentication

User name Methods accepted Result
one of sshGuestUsers (any case) none, password, keyboard-interactive, with any password in, not logged in: the caller lands on the login matrix and can apply
anything else password, keyboard-interactive checked against the user table; on success the caller is logged in

Public keys are not accepted. A failure answers password,keyboard-interactive; the seventh failure on one connection disconnects. Password checks go through the same throttle as the telnet login (Authenticator.php): ten failures from one host, whatever port each connection used, within ten minutes make every attempt from that host fail until they age out, and repeated failures on one handle add a growing delay. A successful login clears both. Locked accounts never pass.

Behind a TCP proxy, list ssh (and telnet, rlogin) in proxyProtocol: the board then reads the PROXY protocol header before the version exchange and uses its address. See deployment.

A client has sshLoginGrace seconds (default 60) from connecting to finish authenticating, and at most maxPendingSsh connections (default 32) may be unauthenticated at once. Channel messages before authentication, or without an open session channel, end the connection. The session channel's window is 64 KiB and is topped up only as the board reads the caller's input; a client that sends past it is disconnected.

A verified SSH login skips the login screen: the matrix menu runs AutoLogin (AutoLogin.php), which logs the account in. Callers then see "Logged in by SSH."

Channels

One session channel per connection. Channel requests:

Request Handling
pty-req terminal type (lowercased) and size
window-change resizes the session
shell starts the call
env COLORTERM is kept (it can select 24-bit colour); other variables are acknowledged and ignored
exec, subsystem, x11-req, others refused

Global requests are refused. OpenSSH sends COLORTERM only when the client configures SendEnv COLORTERM.

RLogin

RloginConnection.php. The client opens with \0client-user\0server-user\0terminal/speed\0; the server answers \0.

Field Used as
server-user the BBS handle
client-user the password
terminal the part before /, lowercased, becomes the terminal type

This follows the convention BBS clients use for rlogin auto-login. When server-user is set, the matrix menu's AutoLogin tries the handle and password through the throttled authenticator; on success the caller is logged in and sees "Logged in by RLOGIN." On failure, or with an empty server-user, the caller gets the login matrix. The handshake times out after ten seconds.

Web

WebServer.php serves, on one address:

Path Serves
/ws the websocket the browser terminal connects to
every #[Get] route JSON or HTML from app code
anything else static files from resources/web/; / is index.html

In .html files these placeholders are replaced: {{ bbs.name }}, {{ bbs.sysop }}, {{ bbs.tagline }}, {{ bbs.location }}, {{ servers.telnet }} and {{ servers.ssh }} (the board's hostname plus the listener's port). HTML is served no-cache; other files are cached for an hour.

Behind a reverse proxy, list the proxy in trustedProxies (WEB_TRUSTED_PROXIES); then X-Forwarded-For sets the caller's address and X-Forwarded-Proto: https marks the connection secure. From any other address both headers are ignored. Proxy /ws as a websocket. A websocket message or frame may be at most 64 KiB.

The websocket protocol

Between app.js and WebSocketConnection.php:

Direction Frame Content
browser → server text {"type":"hello","cols":80,"rows":25} once on open
browser → server text {"type":"resize","cols":…,"rows":…}
browser → server binary keystrokes, UTF-8
server → browser binary screen output, UTF-8 with ANSI escapes

The server waits up to three seconds for hello, then uses 80×24. The session's terminal type is xterm.js and its encoding UTF-8, so the probe does not test the encoding. The page's xterm.js uses the VGA palette and the Web437 IBM VGA 8x16 font, and keeps an 80×25 grid, scaling the font to fit the window. When the socket closes the page shows a reconnect button.

#[Get] routes

Mark a public method with #[Get('/path')] (Get.php). Its parameters are injected from the container, and the Amp request is passed as $request.

Return value Response
array or JsonSerializable 200, application/json, cache-control: no-store
Amp\Http\Server\Response as returned
anything else 200, text/html; charset=utf-8, the value as a string
an exception 500, Server error; the error is logged

The status API

The page's sidebar polls these every 15 seconds. Source: StatusApi.php.

GET /api/status

{
  "name": "The Neon Basement",
  "sysop": "…",
  "tagline": "…",
  "nodes": 8,
  "uptime": 5321,
  "online": [{"node": 1, "handle": "Ghost", "activity": "Reading messages", "via": "telnet"}],
  "stats": {"users": 12, "calls": 340, "messages": 97}
}

uptime is in seconds. via is telnet, ssh, rlogin or web.

GET /api/oneliners: the ten newest, newest first.

[{"handle": "Ghost", "text": "first! ...or so it says", "at": "2026-11-28T20:15:00+00:00"}]

GET /api/last-callers: the ten most recent calls.

[{"handle": "Ghost", "location": "Oslo", "via": "ssh", "at": "2026-11-28T20:15:00+00:00"}]

GET /api/art/matrix: the theme's matrix art as an HTML <pre>, with BN, SN and BT filled and node codes blanked. An empty body when there is no matrix art.

The values in these examples are illustrative.

The terminal probe

After the transport connects, the DetectTerminal step in the connection pipeline calls Terminal::probe() (Terminal.php, DetectTerminal.php). It sends one burst:

Sequence Purpose
ESC[s ESC[255B ESC[255C ESC[6n ESC[u move to the bottom-right corner and ask for the cursor position: the screen size
CR, U+2060, ESC[6n print a zero-width word joiner (3 bytes in UTF-8) at column 1 and ask again
CR ESC[K erase what the test printed
ESC[0c device attributes
Answer Conclusion
no cursor report within 1.5 s no ANSI (TerminalInfo::$ansi = false)
first report screen size, unless the transport already reported one (NAWS, pty-req, websocket) or the answer is implausible (under 20×10, or 231, 255 or 999)
second report at column 3 or later the terminal printed three CP437 characters: CP437
second report at column 1 or 2 UTF-8
a first report of 1;1 broken cursor reporting: CP437
device attributes starting ESC[=67;84;101;114;109 ("CTerm") CTerm/SyncTERM: CTerm colour mode and ESC[?33h for iCE backgrounds; terminal type syncterm if still unknown

The encoding test is skipped when the transport knows the encoding (the web terminal). When requireAnsi is set in configuration and the probe finds no ANSI, the caller is told to use an ANSI terminal and disconnected; it is off by default.

Callers can override the detected encoding and colour mode in Settings. The detected values are available as the display codes TE, EN, SW, SH and SZ; see art.