TinyMUX

WebSocket Support

Hardcode

Overview

TinyMUX supports RFC 6455 WebSocket connections, allowing web-based MU* clients to connect to the server directly from a browser. WebSocket support is integrated into the existing network layer and shares the same port as traditional telnet connections.

Same-Port Auto-Detection

TinyMUX does not require a dedicated port for WebSocket connections. When a new connection arrives, the server uses deferred protocol detection to determine whether the client is speaking the WebSocket upgrade handshake or traditional telnet. The first bytes received on the connection are examined: if they match an HTTP upgrade request, the server completes the WebSocket handshake; otherwise, the connection proceeds as normal telnet.

This means a single port serves both telnet and WebSocket clients simultaneously.

TLS Support

WebSocket over TLS (wss://) is supported via the same deferred protocol detection mechanism. When TLS is configured, the server performs the TLS handshake first, then examines the decrypted traffic to determine whether the client is using WebSocket or telnet. This allows wss:// (secure WebSocket) and telnet-over-TLS connections on the same TLS-enabled port.

Web Client Integration

WebSocket support enables browser-based MU* clients to connect without requiring a proxy or gateway server. A web client can open a WebSocket connection directly to the TinyMUX server and exchange text in the same way a telnet client would. The server handles output encoding, ANSI color conversion, and line buffering identically for WebSocket and telnet connections.

Telnet, Network Layer.