Crate telnet

Crate telnet 

Source
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§

Telnet
A telnet connection to a remote host.

Enums§

Action
Actions for telnet negotiation.
Event
Events generated by Telnet.
SubnegotiationType
TelnetError
TelnetOption
Telnet options

Traits§

Stream