///|
fn main {
let wire = @utf8.encode("PROXY UNKNOWN\r\nDATA", bom=false)
let decoder = @proxyproto.Decoder::new(@proxyproto.DecodePolicy::v1_only())
ignore(decoder.feed(Bytes::from_array(wire.to_array()[0:3])))
ignore(decoder.feed(Bytes::from_array(wire.to_array()[3:10])))
match decoder.feed(Bytes::from_array(wire.to_array()[10:])) {
Done(frame) =>
println("stream payload bytes=" + frame.remaining.length().to_string())
_ => abort("stream decoder did not finish")
}
}