Skip to main content

Crate krot_client

Crate krot_client 

Source
Expand description

KROT client library.

The library exposes the client-side of every operation the CLI supports, so tests and third-party programs can enroll, authenticate and publish tunnels without going through krot on stdin.

Re-exports§

pub use config::ClientConfig;
pub use config::Identity;
pub use config::ServerPin;
pub use enroll::enroll;
pub use enroll::EnrollOptions;
pub use error::ClientError;
pub use inspector::spawn_ui as spawn_inspector_ui;
pub use inspector::Inspector;
pub use local_auth::api_key_from_str;
pub use local_auth::read_env;
pub use local_auth::read_file;
pub use local_auth::session_from_userpass;
pub use local_auth::AuthConfig;
pub use local_auth::AuthConfigError;
pub use local_auth::AuthPolicy;
pub use local_auth::DEFAULT_REALM;
pub use login_page::SessionStore;
pub use session::AuthenticatedSession;
pub use session::SessionTransport;
pub use tunnel::publish_http;
pub use tunnel::publish_http_authed;
pub use tunnel::publish_tcp;

Modules§

config
Persistent client configuration: identity + server pin.
enroll
Bootstrap enrollment: send an Enroll frame with an admin token, obtain the server’s EnrollOk, and persist the identity + server pin locally.
error
Client-side error type.
inspector
Local HTTP inspector: a bounded ring of parsed first-line request / response pairs, plus a tiny embedded web UI on 127.0.0.1:4040 for browsing them.
local_auth
Client-side HTTP auth for published tunnels.
login_page
Styled login page + in-memory session store for --auth tunnels.
proxy
Per-connection proxy: on each server-opened bi-stream, read the DataHeader, dial the local target, then run bytes both ways.
session
Authenticated Control-stream session state on the client side.
tls
rustls ClientConfig with SPKI-fingerprint pinning.
tunnel
Publish one tunnel (TCP or HTTP): register it with the server, then serve every incoming bi-stream by proxying to a local address until the caller signals shutdown or the QUIC connection dies.