-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务端无法处理rtmp流数据 #14
Comments
try this patch, see if it solves the problem, use diff --git a/src/proxy/mod.rs b/src/proxy/mod.rs
index d0e3342..3559e40 100644
--- a/src/proxy/mod.rs
+++ b/src/proxy/mod.rs
@@ -61,7 +61,7 @@ async fn copy_tcp<R: AsyncRead + Unpin, W: AsyncWrite + Unpin>(
if len == 0 {
break;
}
- w.write(&buf[..len]).await?;
+ w.write_all(&buf[..len]).await?;
w.flush().await?;
}
Ok(())
|
对于 mux 这部 也许需要改 protocol/mux/mod.rs 的 line 92:
总而言之所有 AsyncWrite 的方法里面都用 |
所有涉及 TCP 用法: 保存这个内容到 diff --git a/src/protocol/mux/mod.rs b/src/protocol/mux/mod.rs
index 882a42e..35c0e98 100644
--- a/src/protocol/mux/mod.rs
+++ b/src/protocol/mux/mod.rs
@@ -89,7 +89,7 @@ impl RequestHeader {
cursor.put_u8(cmd);
addr.write_to_buf(cursor);
- w.write(&buf).await?;
+ w.write_all(&buf).await?;
Ok(())
}
}
@@ -138,9 +138,9 @@ impl MuxFrame {
cursor.put_u8(command);
cursor.put_u16_le(data_length as u16);
cursor.put_u32_le(stream_id);
- writer.write(&buf).await?;
+ writer.write_all(&buf).await?;
if let MuxFrame::Push(f) = self {
- writer.write(&f.data).await?;
+ writer.write_all(&f.data).await?;
}
writer.flush().await?;
Ok(())
diff --git a/src/protocol/socks5/mod.rs b/src/protocol/socks5/mod.rs
index fe6fd1c..2a6b587 100644
--- a/src/protocol/socks5/mod.rs
+++ b/src/protocol/socks5/mod.rs
@@ -114,7 +114,7 @@ impl TcpResponseHeader {
{
let mut buf = BytesMut::with_capacity(self.serialized_len());
self.write_to_buf(&mut buf);
- w.write(&buf).await?;
+ w.write_all(&buf).await?;
Ok(())
}
diff --git a/src/protocol/trojan/mod.rs b/src/protocol/trojan/mod.rs
index 1ab97b4..72e7e7a 100644
--- a/src/protocol/trojan/mod.rs
+++ b/src/protocol/trojan/mod.rs
@@ -122,7 +122,7 @@ impl RequestHeader {
addr.write_to_buf(cursor);
cursor.put_slice(crlf);
- w.write(&buf).await?;
+ w.write_all(&buf).await?;
Ok(())
}
}
@@ -173,7 +173,7 @@ impl UdpHeader {
self.address.write_to_buf(cursor);
cursor.put_u16(self.payload_len);
cursor.put_slice(b"\r\n");
- w.write(&buf).await?;
+ w.write_all(&buf).await?;
Ok(())
}
}
diff --git a/src/proxy/mod.rs b/src/proxy/mod.rs
index d0e3342..3559e40 100644
--- a/src/proxy/mod.rs
+++ b/src/proxy/mod.rs
@@ -61,7 +61,7 @@ async fn copy_tcp<R: AsyncRead + Unpin, W: AsyncWrite + Unpin>(
if len == 0 {
break;
}
- w.write(&buf[..len]).await?;
+ w.write_all(&buf[..len]).await?;
w.flush().await?;
}
Ok(())
|
居然还在维护? |
@qiuzi 没有, 我也是在使用这个客户端过程中发现 |
作为服务端无法中继twitch的rtmp流
无mux:
开mux无法正常推流 关闭mux会间接性中断
The text was updated successfully, but these errors were encountered: