Repository navigation
Turn MSSP WEBSOCKET into measured WebSocket endpoints - #217
Merged
Merged
Conversation
A game's MSSP WEBSOCKET variable names the addresses a web client can use. It was stored as a field and nothing else, so no game in the catalogue had a websocket endpoint and a client listing games could not offer one. Each declared ws:// or wss:// URL is now handshaken after an answered probe, through the opt-out gate and the scope guard (dialled at the addresses it ruled on), offering no subprotocol, since websockify and MUME's Apache both refuse one they do not know. An address that upgrades becomes an endpoint (kind websocket, or the new wss) with its path; one that does not writes nothing. An address another game holds, or one of this game's telnet addresses, is left as it is. The API's endpoint gains `path` (null except on a websocket); a wss endpoint is kind "websocket" with tlsMeasured true. The game page and plain text show the URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rqqt7SNv2XNNK6ro5YvSJP
A socket that upgraded says nothing about what a client must speak on it. Evennia 6.1 chooses terminal., gmcp. or json.mudstandards.org and never telnet., and with no choice made it talks its own JSON, so a telnet client that dialled an Evennia endpoint listed as "websocket" would send bytes Evennia reads as malformed JSON. The handshake now offers the four mudstandards.org names and keeps the one the server chose. A server that answers the offer with an HTTP refusal (websockify's 400, MUME's Apache 502) is asked again with no offer, so the stricter bridges still upgrade and are recorded with no subprotocol, as before. game_endpoint gains subprotocol (websocket kinds only, an RFC 6455 token), and the API's endpoint gains subProtocol. The game page shows the name beside the URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rqqt7SNv2XNNK6ro5YvSJP
HarryCordewener
marked this pull request as ready for review
November 15, 2026 21:42
HarryCordewener
pushed a commit
that referenced
this pull request
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
pushed a commit
that referenced
this pull request
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
added a commit
that referenced
this pull request
Nov 16, 2026
…port WEBSOCKET support (#216) * 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rqqt7VYxc7wynmb9N719J4 * Measure the WebSocket URL a game declares, beside the declaration 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 * Move to TelnetNegotiationCore 4.13.5, and read bridged WebSocket servers 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 * Drop the WebSocket URL check that #217 already does #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 * Report WEBSOCKET in the capability matrix: unknown, none or standard 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 --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A game's MSSP
WEBSOCKETvariable was stored as a field and nothing else, so no catalogue game had awebsocketendpoint. Two games declare one today: MUME (wss://mume.org/ws-play/) and The Last Outpost (wss://last-outpost.com/ws/telnet/).game_endpoint.pathandgame_endpoint.subprotocol(websocket kinds only, an RFC 6455 token). It is allowed only on websocket kinds, and must be a printable-ASCII path of at most 256 characters. There is a new kindwss. Identity stays(host, port).MUI.Crawl/WebSocket):WebSocketAddressesreads the variable as a comma-separated list. It refuses user information, fragments, non-ASCII text, other schemes and over-long paths. At most 4 addresses are read.WebSocketProbedoes one handshake, at the addresses the scope guard ruled on. It uses no proxy, checks the certificate, and closes straight after the upgrade.mudstandards.orgnames (telnet, gmcp, terminal, json) and records the one the server chooses. Evennia 6.1 picks terminal, gmcp or json, never telnet, and talks its own JSON when nothing is chosen, so the choice is what tells a client what to speak.WebSocketEndpointWriter, run byCrawlCycleafter an answered probe):endpoints[].pathandendpoints[].subProtocol, null except on a websocket. Awssendpoint is reported askind: "websocket"withtlsMeasured: true. The game page and plain text show the URL.Testing
wss+ path, and that nothing is written on a failed handshake, a scope refusal or an opt-out. A database test checks the path constraints.101to the handshake the probe makes. The probe's own pinned-socket path couldn't run here, because the sandbox has no DNS or direct egress.Not done: an endpoint the game stops declaring stays
active, as with every other kind (nothing setsstaleyet).Generated by Claude Code