#telnet #mud #libtelnet

no-std libmudtelnet

low-level Telnet protocol implementation for MUD clients

1 stable release

2.0.1 Nov 11, 2023

#662 in Network programming

Download history 76/week @ 2023-12-18 11/week @ 2023-12-25 190/week @ 2024-01-01 149/week @ 2024-01-08 62/week @ 2024-01-15 150/week @ 2024-01-22 158/week @ 2024-01-29 71/week @ 2024-02-05 38/week @ 2024-02-12 225/week @ 2024-02-19 107/week @ 2024-02-26 143/week @ 2024-03-04 92/week @ 2024-03-11 136/week @ 2024-03-18 325/week @ 2024-03-25 89/week @ 2024-04-01

647 downloads per month

MIT license

35KB
741 lines

Build & Test crates.io Docs

libmudtelnet

A low-level Telnet protocol implementation for MUD clients, written in Rust.

libmudtelnet is a fork of libtelnet-rs, which is itself inspired by the libtelnet.

Changelog

See CHANGELOG.md.

Usage

Check src/tests.rs for an example parser. For a larger example, see the Blightmud MUD client that uses libtelnet-rs for its Telnet handling.

First, construct a parser with Parser::new(). Ideally, you would place this parser somewhere directly behind a socket or external source of data.

When data comes in from the socket, immediately send it into the parser with parser.receive(data). This will append it to the current internal buffer, and process and return any telnet events to be looped over and handled as your application requires.

Any text to be sent back over the socket to the remote end should be sent through parser.send_text(data) to ensure data will be encoded properly for the telnet protocol. Data to be sent will be provided either by a events::TelnetEvents::DataSend event after processing, or as a return from any method used for sending data.

Compatibility

The initial release of libmudtelnet has been tested for compatibility with libtelnet-rs. In general while much of the code has been rewritten to be more idiomatic Rust, the API is the same and breaking changes have been avoided. An upcoming semver incompatible release will be made with broader API changes in the near future.

See CHANGELOG.md for more details.

Credits

Many thanks to:

Dependencies

~135–305KB