Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Jan 29, 2025
1 parent 17f0a95 commit a75a2d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions devolutions-gateway/src/api/fwd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,6 @@ async fn fwd_http(
// 4. Forward the request.

let response = if matches!(request.uri().scheme_str(), Some("ws" | "wss")) {
let conf = state.conf_handle.get_conf();
let sessions = state.sessions;
let subscriber_tx = state.subscriber_tx;
let shutdown_signal = state.shutdown_signal;

// 4.a Prepare the WebSocket upgrade.

// We are discarding the original body.
Expand Down Expand Up @@ -415,6 +410,9 @@ async fn fwd_http(
.err(),
)?;

let conf = state.conf_handle.get_conf();
let shutdown_signal = state.shutdown_signal;

let server_stream = tokio_tungstenite_websocket_handle(
server_ws,
shutdown_signal.clone(),
Expand All @@ -426,6 +424,8 @@ async fn fwd_http(
// 4.c Start WebSocket forwarding.

let span = tracing::Span::current();
let sessions = state.sessions;
let subscriber_tx = state.subscriber_tx;

client_ws.on_upgrade(move |client_ws| {
let client_stream = crate::ws::handle(
Expand Down

0 comments on commit a75a2d1

Please sign in to comment.