mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 15:07:53 +00:00
Add tcp setting to vless outbound
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user