nerve-ipc-core 0.1.1

Core IPC layer for the NERVE protocol: authentication, request lifecycle, transport-agnostic dispatch, Unix Domain Socket server, and WebSocket server.
Documentation
use std::thread;
use tracing::info;

fn main() -> std::io::Result<()> {
    tracing_subscriber::fmt::init();

    let config = nerve_ipc_core::config::Config::default();

    let token = nerve_ipc_core::auth::load_or_create_token(&config.token_path)?;
    info!("auth token loaded (path: {:?})", config.token_path);

    // Start the WebSocket server on a background thread.
    let ws_config = config.clone();
    let ws_token = token.clone();
    thread::spawn(move || {
        if let Err(e) = nerve_ipc_core::ws_server::run_ws(ws_config, ws_token) {
            eprintln!("WebSocket server error: {e}");
        }
    });

    info!("starting NERVE core (UDS: {})", config.uds_path);
    nerve_ipc_core::server::run(&config.uds_path)
}