Skip to main content

proxy_protocol_rs/
lib.rs

1// Copyright (C) 2025-2026 Michael S. Klishin and Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Tokio-native Proxy Protocol (v1 and v2) implementation.
16
17pub mod error;
18pub mod types;
19
20pub mod parse;
21
22pub mod vendor;
23
24pub mod builder;
25
26pub mod config;
27pub mod policy;
28pub mod validator;
29
30pub mod listener;
31pub mod stream;
32
33#[cfg(feature = "axum")]
34pub mod axum;
35
36pub use error::{AcceptError, InvalidReason, ParseError, TlvParseError};
37pub use parse::{V2_SIGNATURE, parse};
38pub use types::{
39    AddressFamily, Command, ProxyAddress, ProxyInfo, SslClientFlags, SslInfo, Tlvs, Transport,
40    TransportProtocol, Version,
41};
42
43pub use builder::HeaderBuilder;
44pub use config::{ProxyProtocolConfig, VersionPreference};
45pub use listener::ProxyProtocolListener;
46pub use policy::{AcceptAll, ConnPolicy, MixedMode, OptionalProxy, PolicyDecision, TrustedProxies};
47pub use stream::{ProxiedStream, ProxyConnectInfo};
48pub use validator::HeaderValidator;
49
50#[cfg(feature = "aws")]
51pub use vendor::AwsTlvs;
52#[cfg(feature = "azure")]
53pub use vendor::AzureTlvs;
54#[cfg(feature = "gcp")]
55pub use vendor::GcpTlvs;