diff --git a/integrations/axum/src/endpoint.rs b/integrations/axum/src/endpoint.rs index 37132c00..d495c171 100644 --- a/integrations/axum/src/endpoint.rs +++ b/integrations/axum/src/endpoint.rs @@ -46,11 +46,12 @@ impl Endpoint { // F: Future> + Send + Sync + 'static, TCtx: Clone, { - Self::builder(router) - .with_endpoints() - .with_websocket() - .with_batching() - .build(ctx_fn) + let mut t = Self::builder(router).with_endpoints(); + #[cfg(feature = "ws")] + { + t = t.with_websocket(); + } + t.with_batching().build(ctx_fn) } /// Construct a new [`Endpoint`](Endpoint) with no features enabled.