ws2tcp-local 0.1.6

Local HTTP proxy client for ws2tcp-router.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use clap::Parser;
use ws2tcp_local_core::{Settings, init_logging, run_proxy};

mod cli;

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<()> {
    let args = cli::Args::parse();
    let settings = Settings::resolve(args.into())?;
    init_logging(settings.log_level.as_deref())?;
    run_proxy(settings, async {
        if let Err(err) = tokio::signal::ctrl_c().await {
            tracing::warn!(error = %err, "failed to listen for Ctrl+C");
        }
    })
    .await
}