Skip to content

Commit

Permalink
fix: swap WebSocketContext
Browse files Browse the repository at this point in the history
  • Loading branch information
omjadas committed Apr 27, 2024
1 parent 800a2fe commit 0aa7a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/proxy/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ where
#[instrument(skip_all)]
async fn handle_websocket(
self,
server_socket: WebSocketStream<TokioIo<Upgraded>>,
client_socket: WebSocketStream<TokioIo<Upgraded>>,
req: Request<()>,
) -> Result<(), tungstenite::Error> {
let uri = req.uri().clone();

#[cfg(any(feature = "rustls-client", feature = "native-tls-client"))]
let (client_socket, _) = tokio_tungstenite::connect_async_tls_with_config(
let (server_socket, _) = tokio_tungstenite::connect_async_tls_with_config(
req,
None,
false,
Expand All @@ -302,7 +302,7 @@ where
.await?;

#[cfg(not(any(feature = "rustls-client", feature = "native-tls-client")))]
let (client_socket, _) = tokio_tungstenite::connect_async(req).await?;
let (server_socket, _) = tokio_tungstenite::connect_async(req).await?;

let (server_sink, server_stream) = server_socket.split();
let (client_sink, client_stream) = client_socket.split();
Expand Down

0 comments on commit 0aa7a39

Please sign in to comment.