Skip to main content

HttpServerConfig

Struct HttpServerConfig 

Source
pub struct HttpServerConfig {
    pub listen: SocketAddr,
    pub extra_origins: Vec<String>,
    pub require_bearer: bool,
    pub max_body_bytes: usize,
    pub shared: Arc<SharedServerConfig>,
}
Expand description

Configuration for crate::Server. All fields are public so adopters can use struct-literal construction; Default::default() returns loopback 127.0.0.1:0 with anonymous-mode bearer policy (matches the Celia http_server.rs precedent in celia-cli/src/http_server.rs:114-130).

Fields§

§listen: SocketAddr

Address the listener binds to. SP-streamable-http §4.6 mandates loopback default — fail-closed against DNS rebinding per MCP Security Warning. Use 127.0.0.1:0 in tests to let the kernel pick a free port.

§extra_origins: Vec<String>

Origin patterns added to the default allow-list (http://127.0.0.1*, http://localhost*, https://127.0.0.1*, https://localhost*, tauri://*). Matched against the request’s Origin header verbatim — full string equality, not prefix. Operators surface this from the --allow-origin CLI flag, repeatable.

§require_bearer: bool

When true, requests without Authorization: Bearer … are rejected with HTTP 401 / JSON-RPC -32002. When false (default), bearer-less requests fall through to anonymous mode with empty CapabilitySet — matching celia-cli/src/http_server.rs:295-306 Tier-0 trust. Bearer-bearing requests are always validated regardless of this flag.

§max_body_bytes: usize

Body-size cap for POST /mcp. Larger requests rejected with HTTP 413. Defaults to DEFAULT_MAX_BODY_BYTES (10 MiB) to match the atd-protocol::wire::MAX_FRAME_BYTES cap.

§shared: Arc<SharedServerConfig>

Shared dispatch-side configuration. Adopters who run UDS + HTTP from the same process build one SharedServerConfig, wrap it in Arc, and pass clones to both transports so they share the audit sink, token broker, capability allow-list, and server identity by reference.

Trait Implementations§

Source§

impl Clone for HttpServerConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for HttpServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more