From 4ee69a1530794282707c2b09fc9dfa239fb653cc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 19:09:16 +0000 Subject: [PATCH 1/5] Move to TelnetNegotiationCore 4.13.2, and probe telnet over WebSocket 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 Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4 --- CLAUDE.md | 7 + Directory.Packages.props | 9 +- src/MUI.Crawl/Telnet/DialFailure.cs | 11 +- src/MUI.Crawl/Telnet/ProbeLine.cs | 185 ++++++++++ src/MUI.Crawl/Telnet/Probing.cs | 46 ++- src/MUI.Crawl/Telnet/TelnetProbe.cs | 242 +++++-------- src/MUI.Crawler/Crawl/CatalogueBinder.cs | 7 +- src/MUI.Crawler/Crawl/CrawlCycle.cs | 4 +- src/MUI.Probe/Program.cs | 10 +- .../Telnet/ProbeSessionTests.cs | 4 +- .../Telnet/WebSocketTransportTests.cs | 322 ++++++++++++++++++ 11 files changed, 676 insertions(+), 171 deletions(-) create mode 100644 src/MUI.Crawl/Telnet/ProbeLine.cs create mode 100644 tests/MUI.Crawl.Tests/Telnet/WebSocketTransportTests.cs diff --git a/CLAUDE.md b/CLAUDE.md index d773e47..52ff458 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -234,6 +234,13 @@ the same pattern anyway, so there is one way to do this in the tree. `mui-crawl exception and says so at the call site: a process that makes one request and exits *is* the handler's lifetime. +**The probe's WebSocket dial is not a third HTTP client either.** `ProbeLine` upgrades a `ws://` or +`wss://` URL to telnet over a WebSocket (`telnet.mudstandards.org`, TelnetNegotiationCore 4.12+) with +a `SocketsHttpHandler` that lives for one dial and whose `ConnectCallback` dials **the addresses the +scope guard vetted**, never a fresh lookup of the name — the same rule the TCP path follows. No +proxy, no cookies, no redirects. It is a probe transport, not a fetch: nothing it reads is anything +but a telnet session. The crawl loop does not dial one yet; `mui-probe wss://…` does. + `game_icon` and `icon_attempt` are the **two tables here that may be dropped and refilled**. The fact is the `ICON` field; those are bytes fetched from the URL it names and our own notes about fetching them, so §7.5's "nothing is ever deleted" does not reach either. A failed fetch writes **nothing diff --git a/Directory.Packages.props b/Directory.Packages.props index 211c8f0..3d33aa6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -18,9 +18,14 @@ 3.0.0 inflates a stream started with MCCP v1's marker, which both Children of the Night servers send in answer to DO COMPRESS2; before it, everything after their connect screens, MSSP report included, arrived as zlib read as text. + + 4.13 runs every read loop through one ITelnetTransport and hands back a TelnetConnection, so + the probe's socket, TLS tunnel and WebSocket differ in ProbeLine and nowhere else. OnStarting + gives callbacks their interpreter before the first byte is read, which PromptSink used to + argue around. --> - - + + - +