Skip to content

Dial WebSocket worlds through an invoker of our own - #147

Merged
HarryCordewener merged 2 commits into
mainfrom
claude/project-thread-dzr97t
Nov 16, 2026
Merged

HarryCordewener merged 2 commits into
mainfrom
claude/project-thread-dzr97t

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Requested by Grave · project thread

Takes TelnetNegotiationCore 4.13.6 (TNC #201: TelnetWebSocketClient.ConnectAsync(uri, invoker, configure, bridges, ct)) and gives WebSocketTransport its own HttpMessageInvoker:

  • SocketsHttpHandler with AllowAutoRedirect = false and UseCookies = false.
  • Certificate check moved to SslOptions.RemoteCertificateValidationCallback, by TcpTransport's rule (no errors, or AllowInvalidCertificates). ClientWebSocketOptions.RemoteCertificateValidationCallback throws once an invoker is passed.
  • A ConnectCallback dials with NoDelay and records the endpoint reached. RemoteDescription is now ws://host:port/path (ip:port), as TcpTransport reports its endpoint. Through a proxy that endpoint is the proxy's.
  • The invoker is disposed with the transport. Keepalive settings stay in configure.

What a user would notice: nothing. RemoteDescription is shown nowhere yet and .NET's default handler already sets NoDelay, so this is labelled skip-changelog. It is the parity step Grave asked for across SharpMUSH, SharpMUTerm and MUIndex.

TlsTargetHost is still not applied on this path: SocketsHttpHandler sets the SNI name from the request URI, not from SslOptions.TargetHost, and nothing in src sets TlsTargetHost today.

Tests: new TheTransportSaysWhichEndpointTheHandshakeReached against the loopback server. Built Release with no warnings. Core suite 1,799/1,800 locally. The one failure, AReadOnlyCacheDirectory_DegradesToMemoryOnly, fails the same way on main here because the container runs as root.


Generated by Claude Code

TelnetNegotiationCore 4.13.6 takes an HttpMessageInvoker for the
WebSocket handshake. WebSocketTransport now owns one: a
SocketsHttpHandler that follows no redirect, keeps no cookies,
checks the certificate by TcpTransport's rule through SslOptions,
and dials the socket with NoDelay. Its ConnectCallback records the
endpoint reached, which RemoteDescription now names beside the
address. The invoker lives until the transport is disposed.

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

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

The handler's socket is dual-mode on the CI runner, so a loopback
peer came back as [::ffff:127.0.0.1]. Unmap it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7TMv2mtCTKbjZigQWZ
@HarryCordewener
HarryCordewener marked this pull request as ready for review November 16, 2026 06:00
@HarryCordewener
HarryCordewener merged commit d8cbb1d into main Nov 16, 2026
3 checks passed
HarryCordewener added a commit that referenced this pull request Nov 24, 2026
v0.3.7 was published without a section of its own, so the log file name
fix it shipped was still under [Unreleased]. It moves to [0.3.7] with the
WebSocket handshake change (#147), and the rest becomes 0.3.8.


Claude-Session: https://claude.ai/code/session_01Rqqt7WtRAmocwURbWZTdxW

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants