INNER CODE UNIT · Rust
run
eepnet/emissary · emissary-cli/src/proxy/http/mod.rs:401
async fn run(self) {
while let Ok((stream, _)) = self.listener.accept().await {
let tx = self.cmd_tx.clone();
tokio::spawn(async move {
let mut lines = BufReader::new(stream).lines();
while let Ok(Some(command)) = lines.next_line().await {
if command.starts_with("HELLO VERSION") {
lines
.get_mut()
.write_all("HELLO REPLY RESULT=OK VERSION=3.2\n".as_bytes())
.await
.unwrap();
continue;
}
if command.starts_with("SESSION CREATE") {