MUX is a lightweight and efficient TCP proxy for Multi-User Dungeon (MUD) servers. It acts as a middleman between clients and the MUD server, allowing multiple clients to connect to the same server instance. MUX maintains a persistent connection to the MUD server, even if no clients are connected, ensuring that no input from the server is missed.
- Persistent MUD Connection: Keeps the MUD connection active even when no clients are connected.
- Client Broadcasting: Forwards data from the MUD server to all connected clients.
- Logging: Configurable logging with support for log rotation using
lumberjack
. - Graceful Shutdown: Cleans up resources and disconnects clients properly on termination.
- Go 1.16 or higher
- Internet access to connect to a MUD server
-
Clone the repository:
git clone https://github.com/yourusername/mux.git cd mux
-
Build the binary:
go build -o mud-mux
-
Run the application:
./mudmux --mud <MUD_SERVER_ADDRESS> --local <LOCAL_ADDRESS> --log <LOG_FILE>
--mud
: Address of the MUD server in the formathost:port
.--local
: Local address to listen on for client connections. Default::8888
.--log
: Path to the log file. If omitted, logs are printed to stdout.
Run MUX with the following settings:
./mud-mux --mud "mud.example.com:4000" --local ":9000" --log "logs/mux.log"
- Start the MUX proxy.
- Connect your MUD client to the local address (e.g.,
localhost:9000
). - Interact with the MUD server through the proxy.
- MUX connects to the specified MUD server and keeps the connection alive.
- It listens for incoming client connections on the specified local address.
- When a client connects:
- Input from the client is forwarded to the MUD server.
- Output from the MUD server is broadcasted to all connected clients.
- If no clients are connected, MUX continues to read and log data from the MUD server.
To stop the MUX server:
- Press
Ctrl+C
. - MUX will:
- Disconnect all clients.
- Close the MUD server connection.
- Clean up resources.
MUX supports logging with optional rotation via the lumberjack library. Logs include:
- Timestamps
- Connection events
- Data transfer between clients and the MUD server
- Errors during operation
- Max Size: 500 MB
- Max Backups: 3
- Max Age: 28 days
- Compression: Enabled
Contributions are welcome! Feel free to submit issues, feature requests, or pull requests to improve MUX.
This project is licensed under the MIT License.
- lumberjack for log rotation.