reauthfi-core 0.1.2

macOS Captive Portal auto-detection and opener CLI tool
Documentation
  • Coverage
  • 0%
    0 out of 52 items documented0 out of 21 items with examples
  • Size
  • Source code size: 56.13 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.34 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 42s Average build duration of successful builds.
  • all releases: 42s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • kazu728/reauthfi
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kazu728

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.