Skip to content

Hmp1BuilderExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for to configure muxer adapters.

csharp
public static class Hmp1BuilderExtensions

Inheritance

ObjectHmp1BuilderExtensions

Methods

WithHmp1Client(Hex1bTerminalBuilder, Func<CancellationToken, Task<Stream>>)

Configures the terminal as an HMP v1 client. The terminal connects to a remote server and displays its output locally.

Parameters:

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1Client(this Hex1bTerminalBuilder builder, Func<CancellationToken, Task<Stream>> streamFactory)

WithHmp1Server(Hex1bTerminalBuilder, Func<CancellationToken, IAsyncEnumerable<Stream>>)

Adds an HMP v1 server listener that accepts client connections from the given stream source. Can be called multiple times to serve over multiple transports simultaneously.

Parameters:

  • builder (Hex1bTerminalBuilder): The terminal builder.
  • streamSource (Func<CancellationToken, Stream>>): A factory that produces an async enumerable of bidirectional streams (one per connecting client). The cancellation token is cancelled when the terminal session ends.

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1Server(this Hex1bTerminalBuilder builder, Func<CancellationToken, IAsyncEnumerable<Stream>> streamSource)

WithHmp1UdsClient(Hex1bTerminalBuilder, string, Func<Stream, Stream>)

Configures the terminal as an HMP v1 client connecting to a Unix domain socket with a stream transform applied after connection. Use this to wrap transport streams with encryption, compression, or other transformations before HMP v1 framing is applied.

Parameters:

  • builder (Hex1bTerminalBuilder): The terminal builder.
  • socketPath (String): Path to the Unix domain socket to connect to.
  • streamTransform (Func<Stream, Stream>): A function that wraps the raw transport stream. The returned stream is used for HMP v1 protocol communication.

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1UdsClient(this Hex1bTerminalBuilder builder, string socketPath, Func<Stream, Stream> streamTransform)

WithHmp1UdsClient(Hex1bTerminalBuilder, string, Func<Stream, Task<Stream>>)

Configures the terminal as an HMP v1 client connecting to a Unix domain socket with an async stream transform applied after connection. Use this when the stream wrapping requires asynchronous setup, such as a TLS handshake.

Parameters:

  • builder (Hex1bTerminalBuilder): The terminal builder.
  • socketPath (String): Path to the Unix domain socket to connect to.
  • streamTransform (Func<Stream, Stream>>): An async function that wraps the raw transport stream. The returned stream is used for HMP v1 protocol communication.

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1UdsClient(this Hex1bTerminalBuilder builder, string socketPath, Func<Stream, Task<Stream>> streamTransform)

WithHmp1UdsClient(Hex1bTerminalBuilder, string)

Configures the terminal as an HMP v1 client connecting to a Unix domain socket.

Parameters:

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1UdsClient(this Hex1bTerminalBuilder builder, string socketPath)

WithHmp1UdsServer(Hex1bTerminalBuilder, string, Func<Stream, Stream>)

Adds an HMP v1 server listener on a Unix domain socket with a stream transform applied to each accepted client connection. Use this to wrap transport streams with encryption, compression, or other transformations before HMP v1 framing is applied.

Parameters:

  • builder (Hex1bTerminalBuilder): The terminal builder.
  • socketPath (String): Path to the Unix domain socket file.
  • streamTransform (Func<Stream, Stream>): A function that wraps the raw transport stream. Called once per client connection. The returned stream is used for HMP v1 protocol communication.

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1UdsServer(this Hex1bTerminalBuilder builder, string socketPath, Func<Stream, Stream> streamTransform)

WithHmp1UdsServer(Hex1bTerminalBuilder, string, Func<Stream, Task<Stream>>)

Adds an HMP v1 server listener on a Unix domain socket with an async stream transform applied to each accepted client connection. Use this when the stream wrapping requires asynchronous setup, such as a TLS handshake.

Parameters:

  • builder (Hex1bTerminalBuilder): The terminal builder.
  • socketPath (String): Path to the Unix domain socket file.
  • streamTransform (Func<Stream, Stream>>): An async function that wraps the raw transport stream. Called once per client connection. The returned stream is used for HMP v1 protocol communication.

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1UdsServer(this Hex1bTerminalBuilder builder, string socketPath, Func<Stream, Task<Stream>> streamTransform)

WithHmp1UdsServer(Hex1bTerminalBuilder, string)

Adds an HMP v1 server listener on a Unix domain socket. Can be called multiple times to serve over multiple sockets.

Parameters:

Returns: Hex1bTerminalBuilder

The builder for fluent chaining.

csharp
public static Hex1bTerminalBuilder WithHmp1UdsServer(this Hex1bTerminalBuilder builder, string socketPath)

Released under the MIT License.