introduce websocket tunnel

This commit is contained in:
sijie.sun
2024-05-11 22:46:23 +08:00
committed by Sijie.Sun
parent a5637003ad
commit 1b1d76de99
12 changed files with 647 additions and 110 deletions
+6
View File
@@ -39,6 +39,11 @@ pub fn get_listener_by_url(
}
#[cfg(feature = "quic")]
"quic" => Box::new(QUICTunnelListener::new(l.clone())),
#[cfg(feature = "websocket")]
"ws" | "wss" => {
use crate::tunnel::websocket::WSTunnelListener;
Box::new(WSTunnelListener::new(l.clone()))
}
_ => {
unreachable!("unsupported listener uri");
}
@@ -154,6 +159,7 @@ impl<H: TunnelHandlerForListener + Send + Sync + 'static + Debug> ListenerManage
}
});
}
tracing::warn!("listener exit");
}
pub async fn run(&mut self) -> Result<(), Error> {