Skip to content

Move to TelnetNegotiationCore 4.13.5, probe telnet over WebSocket, report WEBSOCKET support - #216

Merged
HarryCordewener merged 6 commits into
mainfrom
claude/project-thread-ls60p6
Nov 16, 2026
Merged

HarryCordewener merged 6 commits into
mainfrom
claude/project-thread-ls60p6

Conversation

@HarryCordewener

@HarryCordewener HarryCordewener commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Requested by Grave · project thread

This PR does three things:

  • upgrades the packages
  • gives the probe a telnet-over-WebSocket transport
  • reports a game's WebSocket support in the capability matrix

An earlier commit here checked each declared WEBSOCKET URL during the crawl. #217, now on main, already does that and records the result as an endpoint, and the commit clashed with #217's migration 0045. It has been reverted on this branch.

Packages

  • TelnetNegotiationCore 4.6.1 → 4.13.5
  • MarkupString.Ansi 2.31.0 → 2.31.3

The probe

  • StartAsync on an ITelnetTransport replaces BuildAndStartAsync on a TcpClient or SslStream. The new ProbeLine owns whatever is under a session (TCP, TLS or WebSocket) and is the only place the three differ.
  • OnStarting sets PromptSink's interpreter and reads the MCP plugin before the read loop starts.
  • Live() reads TelnetConnection.Closed, the same on every transport.
  • ProbeTarget.ForWebSocket(uri) dials ws:// or wss://:
    • through a SocketsHttpHandler whose ConnectCallback dials the addresses the scope guard vetted (§7.2)
    • with no proxy, no cookies and no redirects
    • offering the telnet subprotocols, then gmcp and terminal. A server that picks gmcp or terminal (Evennia) is read through TNC's client bridge, which drops the probe's telnet commands.
  • DialFailure unwraps WebSocketException and HttpRequestException.
  • mui-probe wss://host/path probes a URL by hand.

Not adopted: TNC's retry with no subprotocol after an HTTP 400 or 502. ConnectAsync resolves the name itself. HarryCordewener/TelnetNegotiationCore#201 adds an overload that takes an invoker. This affects mui-probe only.

WEBSOCKET in the capability matrix

A new WEBSOCKET row.

Declared comes from MSSP's WEBSOCKET variable, like any other capability.

Measured comes from the WebSocket endpoints #217 records. Only endpoints that are not gone count.

Measured When Cell
standard an endpoint chose a mudstandards.org subprotocol ● standard, linked to https://mudstandards.org/websocket/, with the chosen name
none an endpoint upgraded but chose none (websockify, MUME's Apache, The Last Outpost) ○ none
unknown no endpoint; a declared URL that never upgraded also lands here – unknown

"None" is never shown as the ✕ of an absent capability, and the measured state is never absent. A failed upgrade writes no endpoint, so nothing can say a game has no WebSocket (rule 5).

The API's capabilities[] entry for that row gains webSocket (unknown, none or standard) and subProtocol. The labels are translated into en/de/nl/ja/zh-Hans.

Tests

  • WebSocketTransportTests (12) covers:
    • pinned addresses
    • path and subprotocols
    • MSSP inside the socket
    • a server that names no subprotocol
    • a terminal server read through the bridge with no IAC reaching it
    • a refused upgrade and a refused connect
  • Catalog query tests for unknown, none and standard: a gone standard endpoint doesn't count, and an endpoint with nothing declared still gets the row.
  • Render tests: the standard link and subprotocol, and none and unknown never rendering ✕ or the link.
  • Every suite passes locally on the merge with main: Crawl 676, Crawler 385, Catalog 669, Web 1294, Discovery 365, I3 17. The Postgres suites ran against PostgreSQL 16.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4

Summary by CodeRabbit

  • New Features
    • Added WebSocket support for probing games, including Telnet and terminal bridge connections.
    • Game capability listings now show whether WebSocket support is standard, connected without a recognized standard, or not yet measured. Standard entries include the selected subprotocol.
    • The standalone probe accepts ws:// and wss:// targets.
  • Documentation
    • Clarified how WebSocket probing works and how it differs across probe modes.
  • Localization
    • Added WebSocket capability labels and explanations in English, German, Japanese, Dutch, and Simplified Chinese.

TelnetNegotiationCore 4.6.1 -> 4.13.2 and MarkupString.Ansi 2.31.0 -> 2.31.3.

The probe now starts its sessions with StartAsync on an ITelnetTransport
rather than BuildAndStartAsync on a TcpClient or SslStream. ProbeLine owns
the socket under a session (TCP, TLS or WebSocket) and is the only place
the three differ; the two copies of the connect-and-handshake code in
SessionAsync and the plaintext MSSP trial are gone.

OnStarting sets PromptSink's interpreter and the MCP plugin before the read
loop reads a byte, instead of straight after the build and arguing that no
prompt could arrive in between.

Live() reads TelnetConnection.Closed instead of polling the TcpClient, so it
works on every transport and sees a TLS peer's close the same way.

ProbeTarget.ForWebSocket(uri) dials a ws:// or wss:// URL offering
telnet.mudstandards.org and telnet. The upgrade goes through a one-dial
SocketsHttpHandler whose ConnectCallback dials the scope guard's vetted
addresses, never a fresh lookup. DialFailure unwraps WebSocketException and
HttpRequestException to the socket or TLS error under them. mui-probe
takes a ws:// or wss:// URL in place of the host. The crawl loop does not
dial WebSockets yet; CatalogueBinder and CrawlCycle are made correct for a
WebSocket result so wiring it later cannot mislabel one as telnet or
clear a target's TLS flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The probe now supports Telnet traffic over WebSocket. Crawl results distinguish WebSocket endpoints from Telnet and TLS endpoints. Capability queries derive WebSocket support states and subprotocols, which the API and capability matrix expose.

Changes

WebSocket Telnet probing and capability reporting

Layer / File(s) Summary
WebSocket probe targets and transport
src/MUI.Crawl/Telnet/Probing.cs, src/MUI.Crawl/Telnet/ProbeLine.cs, src/MUI.Crawl/Telnet/DialFailure.cs, Directory.Packages.props, CLAUDE.md
The probe accepts ws and wss targets and opens WebSocket connections through ProbeLine. WebSocket and HTTP dial exceptions are classified through their inner exceptions. The package versions and probe documentation are updated.
Telnet sessions over WebSocket
src/MUI.Crawl/Telnet/TelnetProbe.cs, src/MUI.Probe/Program.cs, tests/MUI.Crawl.Tests/Telnet/*
TelnetProbe runs WebSocket targets through a shared Telnet connection abstraction. The CLI recognizes WebSocket URLs. Tests cover Telnet and terminal bridges, MSSP negotiation, vetted-address dialing, and failed connections.
Endpoint recording and capability projection
src/MUI.Crawler/Crawl/*, src/MUI.Catalog/Games/Views.cs, src/MUI.Catalog/Persistence/*, tests/MUI.Catalog.Tests/Persistence/Queries/GameQueriesPostgresTests.cs
The crawler records WebSocket endpoints and excludes WebSocket results from TLS preference updates. Capability queries derive WebSocket state and subprotocol from declarations and live endpoints.
API and capability matrix
src/MUI.Web/Api/*, src/MUI.Web/Components/CapabilityMatrix.razor, src/MUI.Web/Fixtures/FixtureGameQueries.cs, src/MUI.Web/Localization/Messages.Chrome.cs, src/MUI.Web/Resources/Messages*.resx, tests/MUI.Web.Tests/CapabilityMatrixTests.cs
The API includes WebSocket state and subprotocol fields. The capability matrix renders standard, none, and unknown states, with localized labels and titles. Fixtures and tests cover the rendered states.

Estimated code review effort: 4 (Complex) | ~50 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TelnetProbe
  participant ProbeLine
  participant WebSocketEndpoint
  participant TelnetConnection
  TelnetProbe->>ProbeLine: Open WebSocket target
  ProbeLine->>WebSocketEndpoint: Upgrade using offered subprotocols
  WebSocketEndpoint-->>ProbeLine: WebSocket connection
  ProbeLine-->>TelnetProbe: Expose bridge transport
  TelnetProbe->>TelnetConnection: Start Telnet over bridge transport
  TelnetConnection-->>TelnetProbe: Telnet session data
Loading
Merge Risk: Moderate · up to 47c2b

The probe can record an empty, immediately closed WebSocket session as a successful answer. This is a bounded accuracy problem in the new WebSocket path, which only the manual probe CLI reaches today. Add the guard before merging so empty sessions are reported as failures.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

WEBSOCKET joins the capability pairs. A game's MSSP WEBSOCKET value already
became capability.websocket.declared; the crawl loop now dials the first
ws:// or wss:// URL it names and writes capability.websocket.measured
under the handshake source (rule 1).

The check runs after a game's own probe answers, at most once a day per
address (crawl_target.websocket_checked_at, migration 0045,
DiscoveryOptions.WebSocketCheckInterval). It goes through the opt-out
and the scope guard on the URL's host with no operator-seed exemption,
dials the vetted addresses, and types nothing (ProbeTarget.AsksNothing):
the measurement already asked what there was to ask.

True needs a telnet session that said something. False only for an
answer from the far end: refused, a TLS handshake it would not finish,
or an upgrade it turned down. A timeout, no route or failed lookup writes
nothing about the game, and nothing from the check reaches presence,
availability or endpoints.

The game page's disagreement sentence for WEBSOCKET says the URL was
dialled and did not answer with a telnet session, not that a handshake
never offered it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4
@HarryCordewener HarryCordewener changed the title Move to TelnetNegotiationCore 4.13.2, and probe telnet over WebSocket Move to TelnetNegotiationCore 4.13.2, and measure games' WebSocket URLs Nov 15, 2026
The probe's WebSocket dial now offers gmcp.mudstandards.org and
terminal.mudstandards.org after the telnet names, and reads a server
that picks one through TNC's client bridge. Evennia has no telnet layer
on its WebSocket and picks gmcp; before this, a check of its declared
URL could only fail. The bridge drops the probe's telnet commands, so a
server with no telnet layer never sees IAC bytes in front of its login.

The dial still connects its own ClientWebSocket so it can dial the
scope guard's addresses. 4.13.5's redial with no subprotocol after an
HTTP error (websockify, Apache) needs ConnectAsync to accept an
invoker, which is TelnetNegotiationCore#201.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4
@HarryCordewener HarryCordewener changed the title Move to TelnetNegotiationCore 4.13.2, and measure games' WebSocket URLs Move to TelnetNegotiationCore 4.13.5, and measure games' WebSocket URLs Nov 16, 2026
#217 (merged on main) checks each declared WEBSOCKET URL with a
handshake through the opt-out and the scope guard, retries with no
subprotocol after an HTTP refusal, and records the result as an endpoint.
This branch's check measured the same URLs again, under a second
migration numbered 0045. This commit removes it: WebSocketCheck,
websocket_checked_at, capability.websocket.measured, AsksNothing and the
disagreement sentence.

What stays from this branch is TelnetNegotiationCore 4.13.5 and the
probe's telnet-over-WebSocket transport (ProbeLine, mui-probe wss://).
The transport test now names System.Net.WebSockets.WebSocket in full,
because main's MUI.Crawl.Tests.WebSocket namespace shadows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4
@HarryCordewener HarryCordewener changed the title Move to TelnetNegotiationCore 4.13.5, and measure games' WebSocket URLs Move to TelnetNegotiationCore 4.13.5, and probe telnet over WebSocket Nov 16, 2026
The matrix gains a WEBSOCKET row. Declared comes from MSSP's WEBSOCKET
variable like any other capability. Measured comes from the WebSocket
endpoints the crawl recorded (#217), which no telnet handshake can show:

- standard: a live endpoint chose a mudstandards.org subprotocol. The
  cell links https://mudstandards.org/websocket/ and names the choice.
- none: a live endpoint upgraded but chose none (websockify, MUME's
  Apache, The Last Outpost).
- unknown: no live endpoint, which is also what a declared URL that
  never upgraded looks like.

None is never shown as absent and measured is never Absent: a failed
upgrade writes no endpoint, so nothing here says a game has no
WebSocket (rule 5). The API's capability gains webSocket and
subProtocol on that row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4
@HarryCordewener HarryCordewener changed the title Move to TelnetNegotiationCore 4.13.5, and probe telnet over WebSocket Move to TelnetNegotiationCore 4.13.5, probe telnet over WebSocket, report WEBSOCKET support Nov 16, 2026
@HarryCordewener
HarryCordewener marked this pull request as ready for review November 16, 2026 05:05
@HarryCordewener
HarryCordewener merged commit aba5858 into main Nov 16, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants