Add tcp setting to vless outbound

This commit is contained in:
Keivan-sf
2023-10-19 11:57:44 +03:30
parent 9173c55194
commit 95bca7bce5
2 changed files with 13 additions and 2 deletions

View File

@@ -33,8 +33,8 @@ pub struct NonHeaderObject {
#[allow(non_snake_case)]
#[derive(Serialize, Deserialize)]
pub struct TCPSettings {
header: Option<NonHeaderObject>,
acceptProxyProtocol: Option<bool>,
pub header: Option<NonHeaderObject>,
pub acceptProxyProtocol: Option<bool>,
}
#[allow(non_snake_case)]
@@ -67,6 +67,7 @@ pub struct StreamSettings {
pub security: String,
pub tlsSettings: Option<TlsSettings>,
pub wsSettings: Option<WsSettings>,
pub tcpSettings: Option<TCPSettings>,
}
#[allow(non_snake_case)]

View File

@@ -35,6 +35,16 @@ fn create_outbound_object(data: models::VlessData) -> Outbound {
} else {
None
},
tcpSettings: if data.query.r#type == String::from("tcp") {
Some(TCPSettings {
header: Some(NonHeaderObject {
r#type: String::from("none"),
}),
acceptProxyProtocol: None,
})
} else {
None
},
},
settings: OutboundSettings::Vless(VlessOutboundSettings {
vnext: vec![VlessServerObject {