feat: pending test

This commit is contained in:
2022-08-23 02:30:10 +08:00
parent 9e9301d4d7
commit 67e1d2f495
4 changed files with 40 additions and 26 deletions

View File

@@ -26,10 +26,11 @@ pub async fn run(listen_config: &ListenConfig) -> XResult<()> {
information!("Connection accepted from {:?}", connection.remote_addr());
while let Ok(Some(stream)) = connection.accept_bidirectional_stream().await {
// spawn a new task for the stream
let connection_id = connection.id();
let proxy_address = proxy_address.clone();
tokio::spawn(async move {
information!("Stream opened from {:?}", stream.connection().remote_addr());
let conn_count = format!("{}", rust_util::util_time::get_current_millis());
let conn_count = format!("{}-{}-{}", rust_util::util_time::get_current_millis(), connection_id, stream.id());
if let Err(e) = io_util::transfer_for_server_to_remote(stream, proxy_address, conn_count).await {
failure!("Server - Client error: {}", e);
}