feat: pool and multiplex relay-to-relay tcp channels

This commit is contained in:
L
2026-02-24 08:24:50 +00:00
parent a45a9b0392
commit 37090d80b0
2 changed files with 371 additions and 44 deletions

View File

@@ -57,6 +57,30 @@ pub struct RelayForwardPrelude {
pub initial_data: Vec<u8>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct R2rStreamData {
pub session_id: String,
pub stream_id: String,
pub data: Vec<u8>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct R2rStreamClosed {
pub session_id: String,
pub stream_id: String,
pub reason: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", content = "data")]
pub enum R2rFrame {
Open(RelayForwardPrelude),
Data(R2rStreamData),
Close(R2rStreamClosed),
Ping,
Pong,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", content = "data")]
pub enum ClientFrame {