Add top-level README.md with alpha status warning, quick start guide, architecture overview, feature flags, transport modes, auth docs, and Node.js API examples. Add dual LICENSE-MIT and LICENSE-APACHE files. Add comprehensive crate-level and module-level rustdoc to all three crates (wraith-core, wraith, wraith-napi) and all public modules (transport, client, server, auth, socks5, error). Add doc comments to key public types (Transport, TransportAcceptor, ConnectOptions, ClientSession, Server, ServeOptions, KeySource, ServerAuthConfig, etc). Update Cargo.toml files with workspace-level package metadata (version, edition, license, repository) and crate descriptions.
30 lines
761 B
Rust
30 lines
761 B
Rust
//! # wraith-napi
|
|
//!
|
|
//! Node.js native addon for [Wraith](https://github.com/alkdev/wraith) via napi-rs.
|
|
//! Exposes `connect()` and `serve()` functions for programmatic SSH tunnel creation.
|
|
//!
|
|
//! > **Alpha software.** The NAPI interface may change between versions.
|
|
//!
|
|
//! # Quick example (Node.js)
|
|
//!
|
|
//! ```js
|
|
//! const { connect, serve } = require('wraith-napi');
|
|
//!
|
|
//! // Client: open a duplex SSH stream
|
|
//! const stream = await connect({
|
|
//! server: "example.com:22",
|
|
//! transport: "tcp",
|
|
//! identity: "/path/to/key",
|
|
//! });
|
|
//! await stream.write(Buffer.from("hello"));
|
|
//! const data = await stream.read(1024);
|
|
//! await stream.close();
|
|
//! ```
|
|
|
|
#[allow(unused_imports)]
|
|
#[macro_use]
|
|
extern crate napi_derive;
|
|
|
|
mod connect;
|
|
mod serve;
|