//! Standalone binary: bind `ws://127.0.0.1:8081/echo`, echo audio_in → audio_out.
//! Dev-loop brain the core dials out to (spec §2.3, §8.3).

use std::net::SocketAddr;

use rutster_tap_echo::start_echo_server;
use tracing::info;

#[tokio::main]
async fn main() {
    tracing_subscriber::fmt()
        .with_env_filter(
            tracing_subscriber::EnvFilter::try_from_default_env()
                .unwrap_or_else(|_| "rutster_tap_echo=info".into()),
        )
        .init();

    let addr: SocketAddr = "127.0.0.1:8081".parse().expect("valid addr");
    info!(%addr, "rutster-tap-echo listening");
    let handle = start_echo_server(addr).await.expect("bind ok");
    // Run forever (Ctrl-C terminates the process; no graceful shutdown yet).
    let _ = handle.join.await;
}
