Crate telnet[][src]

Expand description
MCCP2

A feature of some telnet servers is MCCP2 which allows the downstream data to be compressed. To use this, first enable the zcstream rust feature for this crate. Then in the code deal with the relevant events, and switch the zlib when appropriate.

Basic usage example:

match event {
    Event::Data(buffer) => {
        println!("{}", &std::str::from_utf8(&(*buffer)).unwrap());
    },
    Event::Negotiation(Action::Will, TelnetOption::Compress2) => {
        telnet.negotiate(Action::Do, TelnetOption::Compress2);
    },
    Event::Subnegotiation(TelnetOption::Compress2, _) => {
        telnet.begin_zlib();
    }
}

Structs

A telnet connection to a remote host.

Enums

Actions for telnet negotiation.

Events generated by Telnet.

Telnet options

Traits