nntp_proxy/protocol/
mod.rs1use anyhow::Result;
6use std::net::SocketAddr;
7use tokio::io::AsyncWriteExt;
8use tokio::net::TcpStream;
9use tracing::debug;
10
11mod response;
12
13pub use response::ResponseParser;
14
15#[allow(unused_imports)]
17pub use response::NntpResponse;
18
19pub async fn send_proxy_greeting(
23 client_stream: &mut TcpStream,
24 client_addr: SocketAddr,
25) -> Result<()> {
26 let proxy_greeting = b"200 NNTP Proxy Ready\r\n";
27 client_stream.write_all(proxy_greeting).await?;
28 debug!("Sent proxy greeting to client {}", client_addr);
29 Ok(())
30}