mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 15:07:53 +00:00
Support kcp stream
This commit is contained in:
@@ -47,6 +47,19 @@ pub struct GRPCSettings {
|
|||||||
pub serviceName: Option<String>,
|
pub serviceName: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
|
pub struct KCPSettings {
|
||||||
|
pub mtu: Option<u32>,
|
||||||
|
pub tti: Option<u32>,
|
||||||
|
pub uplinkCapacity: Option<u32>,
|
||||||
|
pub downlinkCapacity: Option<u32>,
|
||||||
|
pub congestion: Option<bool>,
|
||||||
|
pub readBufferSize: Option<u32>,
|
||||||
|
pub writeBufferSize: Option<u32>,
|
||||||
|
pub seed: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct RealitySettings {
|
pub struct RealitySettings {
|
||||||
@@ -110,6 +123,7 @@ pub struct StreamSettings {
|
|||||||
pub realitySettings: Option<RealitySettings>,
|
pub realitySettings: Option<RealitySettings>,
|
||||||
pub grpcSettings: Option<GRPCSettings>,
|
pub grpcSettings: Option<GRPCSettings>,
|
||||||
pub quicSettings: Option<QuicSettings>,
|
pub quicSettings: Option<QuicSettings>,
|
||||||
|
pub kcpSettings: Option<KCPSettings>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|||||||
@@ -79,6 +79,20 @@ pub fn create_outbound_object(data: models::VlessData) -> Outbound {
|
|||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
|
kcpSettings: if network_type == String::from("kcp") {
|
||||||
|
Some(KCPSettings {
|
||||||
|
mtu: None,
|
||||||
|
tti: None,
|
||||||
|
congestion: None,
|
||||||
|
uplinkCapacity: None,
|
||||||
|
readBufferSize: None,
|
||||||
|
writeBufferSize: None,
|
||||||
|
downlinkCapacity: None,
|
||||||
|
seed: data.query.seed,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
},
|
},
|
||||||
settings: OutboundSettings::Vless(VlessOutboundSettings {
|
settings: OutboundSettings::Vless(VlessOutboundSettings {
|
||||||
vnext: vec![VlessServerObject {
|
vnext: vec![VlessServerObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user