()
| 206 | |
| 207 | #[tokio::test] |
| 208 | async fn parses_v1_ipv4() { |
| 209 | // v1 is ASCII: "PROXY TCP4 <src> <dst> <sport> <dport>\r\n" |
| 210 | let header = b"PROXY TCP4 1.2.3.4 5.6.7.8 11111 22222\r\n"; |
| 211 | let (_stream, parsed) = read_proxy_header(&header[..]).await.expect("v1 parse"); |
| 212 | let (src, dst) = extract_v4(parsed); |
| 213 | assert_eq!(src.ip().octets(), [1, 2, 3, 4]); |
| 214 | assert_eq!(src.port(), 11111); |
| 215 | assert_eq!(dst.ip().octets(), [5, 6, 7, 8]); |
| 216 | assert_eq!(dst.port(), 22222); |
| 217 | } |
| 218 | |
| 219 | #[tokio::test] |
| 220 | async fn parses_v2_ipv4() { |
nothing calls this directly
no test coverage detected