reauthfi-core

Crates.ioreauthfi-core
lib.rsreauthfi-core
version0.1.2
created_at2025-10-16 11:16:53.266136+00
updated_at2025-10-16 11:16:53.266136+00
descriptionmacOS Captive Portal auto-detection and opener CLI tool
homepage
repositoryhttps://github.com/kazu728/reauthfi
max_upload_size
id1885770
size56,137
Kazuki Matsuo (kazu728)

documentation

README

reauthfi-core

Core library for the reauthfi captive portal detector.

Overview

reauthfi-core contains the detection logic shared by the CLI and Node.js bindings. It probes known endpoints, inspects gateway responses, and opens the detected portal URL on supported platforms (currently macOS).

Usage

Add the crate to your Cargo.toml:

[dependencies]
reauthfi-core = "0.1.2"

Basic example:

use reauthfi_core::{run, ExecutionStatus, Options};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let options = Options {
        verbose: true,
        no_open: true,
        gateway: false,
        timeout: 10,
    };

    match run(&options) {
        Ok(ExecutionStatus::Completed) => println!("No captive portal detected"),
        Ok(ExecutionStatus::NetworkNotReady) => println!("Network not ready"),
        Err(err) => eprintln!("Detection failed: {err}"),
    }

    Ok(())
}

On non-macOS platforms the library currently returns ReauthfiError::UnsupportedPlatform.

License

MIT License.

Commit count: 0

cargo fmt