mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 15:07:53 +00:00
Add reality settings to vless outbound
This commit is contained in:
@@ -30,6 +30,16 @@ pub struct NonHeaderObject {
|
|||||||
pub r#type: String,
|
pub r#type: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
|
pub struct RealitySettings {
|
||||||
|
pub fingerprint: String,
|
||||||
|
pub serverName: String,
|
||||||
|
pub publicKey: String,
|
||||||
|
pub shortId: String,
|
||||||
|
pub spiderX: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct TCPSettings {
|
pub struct TCPSettings {
|
||||||
@@ -68,6 +78,7 @@ pub struct StreamSettings {
|
|||||||
pub tlsSettings: Option<TlsSettings>,
|
pub tlsSettings: Option<TlsSettings>,
|
||||||
pub wsSettings: Option<WsSettings>,
|
pub wsSettings: Option<WsSettings>,
|
||||||
pub tcpSettings: Option<TCPSettings>,
|
pub tcpSettings: Option<TCPSettings>,
|
||||||
|
pub realitySettings: Option<RealitySettings>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fn create_outbound_object(data: models::VlessData) -> Outbound {
|
|||||||
disableSystemRoot: None,
|
disableSystemRoot: None,
|
||||||
preferServerCipherSuites: None,
|
preferServerCipherSuites: None,
|
||||||
fingerprint: Some(String::from("")),
|
fingerprint: Some(String::from("")),
|
||||||
serverName: Some(data.query.sni),
|
serverName: Some(data.query.sni.clone()),
|
||||||
allowInsecure: Some(false),
|
allowInsecure: Some(false),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -45,6 +45,17 @@ fn create_outbound_object(data: models::VlessData) -> Outbound {
|
|||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
|
realitySettings: if data.query.security == String::from("reality") {
|
||||||
|
Some(RealitySettings {
|
||||||
|
publicKey: data.query.pbk,
|
||||||
|
serverName: data.query.sni.clone(),
|
||||||
|
shortId: data.query.sid,
|
||||||
|
spiderX: String::from(""),
|
||||||
|
fingerprint: data.query.fp,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
},
|
},
|
||||||
settings: OutboundSettings::Vless(VlessOutboundSettings {
|
settings: OutboundSettings::Vless(VlessOutboundSettings {
|
||||||
vnext: vec![VlessServerObject {
|
vnext: vec![VlessServerObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user