mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 06:57:52 +00:00
Add grpc stream settings
This commit is contained in:
@@ -31,6 +31,13 @@ pub struct NonHeaderObject {
|
||||
pub r#type: String,
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct GRPCSettings {
|
||||
pub multiMode: bool,
|
||||
pub serviceName: String,
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct RealitySettings {
|
||||
@@ -80,6 +87,7 @@ pub struct StreamSettings {
|
||||
pub wsSettings: Option<WsSettings>,
|
||||
pub tcpSettings: Option<TCPSettings>,
|
||||
pub realitySettings: Option<RealitySettings>,
|
||||
pub grpcSettings: Option<GRPCSettings>,
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
||||
@@ -55,6 +55,14 @@ pub fn create_outbound_object(data: models::VlessData) -> Outbound {
|
||||
} else {
|
||||
None
|
||||
},
|
||||
grpcSettings: if data.query.r#type == String::from("grpc") {
|
||||
Some(GRPCSettings {
|
||||
multiMode: false,
|
||||
serviceName: data.query.service_name,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
},
|
||||
},
|
||||
settings: OutboundSettings::Vless(VlessOutboundSettings {
|
||||
vnext: vec![VlessServerObject {
|
||||
|
||||
Reference in New Issue
Block a user