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