Function start_unix

Source
pub async fn start_unix(unix_path: &str, target_addr: &str) -> Result<()>
Expand description

Start a Unix domain socket proxy from unix_path to target_addr.

Removes the existing socket file if it exists before binding.

§Example

async {
    tokio_multi_proxy::start_unix("/tmp/proxy.sock", "127.0.0.1:9000").await.unwrap();
};
Examples found in repository?
examples/unix.rs (line 6)
4async fn main() -> anyhow::Result<()> {
5    println!("Starting Unix proxy: /tmp/proxy.sock → 127.0.0.1:9000");
6    start_unix("/tmp/proxy.sock", "127.0.0.1:9000").await
7}