1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Protocol-detection utilities used by the Ignitia HTTP server.
//!
//! The server can operate in three modes:
//! • HTTP/1.1 only
//! • HTTP/2 only
//! • Automatic detection (decide per connection)
//!
//! When TLS is enabled, ALPN (Application-Layer Protocol Negotiation) is
//! leveraged to discover whether the client prefers `h2` (HTTP/2) or
//! `http/1.1`.
//!
//! Without TLS—or when ALPN is unavailable—we fall back to the configuration
//! flags in `ServerConfig`:
//! • `auto_protocol_detection = true` ➜ probe each connection.
//! • `http2.enable_prior_knowledge = true` ➜ treat clear-text traffic as
//! HTTP/2 if the first client bytes match the HTTP/2 connection preface
//! (handled elsewhere).
//!
//! This file keeps the surface area minimal so it can be reused by both the
//! plain-text and TLS connection paths with no extra dependencies.
/// Enumerates the protocols the server knows how to serve.
/// Helper object; currently stateless but separated to isolate feature-gated
/// code behind `cfg(feature = "tls")`.
///
/// Additional detection strategies (e.g., Prior-Knowledge preface sniffing)
/// could be added here in the future without touching call-sites.
;