Skip to main content

rws_proxy/
lib.rs

1//! The proxy and operations layer of rust-web-server: reverse proxy, config-driven routes, load balancing, L4 and WebSocket proxies, the admin API, cluster sync, fleet pull, WAF, LLM and A2A gateways, FastCGI, traffic insights.
2//!
3//! Internal to rust-web-server, released with it at the same version: use
4//! these through the `rust_web_server` paths, which stay stable; this
5//! crate's own layout may change in any release. See
6//! `spec/WORKSPACE_SPLIT.md`.
7#![cfg_attr(docsrs, feature(doc_cfg))]
8
9// Derive output (rws-macros) names `::rust_web_server::…`; in this crate's
10// tests that is this crate.
11#[cfg(test)]
12extern crate self as rust_web_server;
13
14// The layers below, under the paths the moved code uses (`crate::request`, …);
15// public (hidden) so doctests can name them as `rust_web_server::…`.
16#[allow(unused_imports)]
17#[doc(hidden)]
18pub use rws_server::{app, app_manifest, application, authz, blocklist, cache, config_reload, core, disk_guard, early_hints, entry_point, error, ext, feature, header, http, http_client, ip_filter, maintenance, mcp, metrics, middleware, range, rate_limit, request, request_log, response, rewrite, router, server, server_config, service_discovery, session, sse, state, url};
19#[cfg(feature = "auth")]
20#[doc(hidden)]
21pub use rws_server::auth;
22#[cfg(not(target_arch = "wasm32"))]
23#[doc(hidden)]
24pub use rws_server::circuit_breaker;
25#[cfg(all(any(feature = "http-client", feature = "http2"), not(target_arch = "wasm32")))]
26#[doc(hidden)]
27pub use rws_server::crypto_provider;
28#[cfg(not(target_arch = "wasm32"))]
29#[doc(hidden)]
30pub use rws_server::log;
31#[cfg(not(target_arch = "wasm32"))]
32#[doc(hidden)]
33pub use rws_server::otel;
34#[cfg(not(target_arch = "wasm32"))]
35#[doc(hidden)]
36pub use rws_server::redis_protocol;
37#[cfg(feature = "sso")]
38#[doc(hidden)]
39pub use rws_server::sso;
40#[cfg(any(feature = "model-sqlite", feature = "model-postgres", feature = "model-mysql"))]
41#[doc(hidden)]
42pub use rws_server::model;
43#[cfg(all(unix, any(feature = "http1", feature = "http2")))]
44#[doc(hidden)]
45pub use rws_server::systemd;
46#[cfg(not(target_arch = "wasm32"))]
47#[doc(hidden)]
48pub use rws_server::timeout;
49#[cfg(feature = "http2")]
50#[doc(hidden)]
51pub use rws_server::tls;
52#[cfg(all(any(feature = "http-client", feature = "http2"), not(target_arch = "wasm32")))]
53#[doc(hidden)]
54pub use rws_server::tls_client_builder;
55#[cfg(not(target_arch = "wasm32"))]
56#[doc(hidden)]
57pub use rws_server::websocket;
58#[cfg(feature = "acme")]
59#[doc(hidden)]
60pub use rws_acme::acme;
61#[cfg(feature = "storage-s3")]
62#[doc(hidden)]
63pub use rws_storage::storage;
64#[cfg(feature = "wasm-plugins")]
65#[doc(hidden)]
66pub use rws_wasm_plugin::wasm_plugin;
67
68#[cfg(not(target_arch = "wasm32"))]
69pub mod proxy;
70#[cfg(not(target_arch = "wasm32"))]
71pub mod proxy_config;
72#[cfg(not(target_arch = "wasm32"))]
73pub mod admin;
74/// `app.dev_mcp()`: an MCP endpoint for a coding agent (18.28.0).
75#[cfg(not(target_arch = "wasm32"))]
76pub mod dev_mcp;
77/// `rws gen model|route|migration|test`: code generators for the
78/// conventional layout (18.29.0).
79#[cfg(not(target_arch = "wasm32"))]
80pub mod generator;
81/// `rws db migrate|rollback|status|seed`: the project's migrations and
82/// seeds from the command line (18.30.0).
83#[cfg(not(target_arch = "wasm32"))]
84pub mod db_cli;
85/// Runtime state shared across replicas through Redis (18.22.0).
86#[cfg(not(target_arch = "wasm32"))]
87pub mod cluster;
88/// Fleet config pull: signed configs from HTTPS, S3 or git (18.23.0).
89#[cfg(all(feature = "http2", not(target_arch = "wasm32")))]
90pub mod fleet;
91pub mod config_check;
92#[cfg(not(target_arch = "wasm32"))]
93pub mod llm;
94#[cfg(not(target_arch = "wasm32"))]
95pub mod tcp_proxy;
96#[cfg(not(target_arch = "wasm32"))]
97pub mod udp_proxy;
98#[cfg(not(target_arch = "wasm32"))]
99pub mod ws_proxy;
100#[cfg(not(target_arch = "wasm32"))]
101pub mod canary;
102#[cfg(not(target_arch = "wasm32"))]
103pub mod ingress;
104/// Web application firewall: rws's own rules (18.22.0).
105pub mod waf;
106pub mod a2a;
107/// FastCGI client: PHP through php-fpm (18.21.0).
108#[cfg(not(target_arch = "wasm32"))]
109pub mod fastcgi;
110pub mod traffic;
111
112#[cfg(test)]
113pub(crate) mod test_env;
114// Lower modules only the tests use.
115#[cfg(test)]
116pub(crate) use rws_server::test_client;
117#[cfg(all(test, feature = "http2"))]
118pub(crate) use rws_server::h2_server;
119#[cfg(all(test, feature = "http3"))]
120pub(crate) use rws_server::h3_handler;