[][src]Crate telnet

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:

This example is not tested
match event {
	TelnetEvent::Data(buffer) => {
		println!("{}", &std::str::from_utf8(&(*buffer)).unwrap());
	},
	TelnetEvent::Negotiation(NegotiationAction::Will, TelnetOption::Compress2) => {
		telnet.negotiate(NegotiationAction::Do, TelnetOption::Compress2);
	},
	TelnetEvent::Subnegotiation(TelnetOption::Compress2, _) => {
		telnet.begin_zlib();
	}
}

Structs

Telnet

A telnet connection to a remote host.

Enums

NegotiationAction

Actions for telnet negotiation.

TelnetEvent

Events generated by Telnet.

TelnetOption

Telnet options

Traits

Stream