Add headers for vless ws

This commit is contained in:
Keivan-sf
2025-06-23 12:25:27 +03:30
parent b4dacb5aa5
commit 0308e55478
2 changed files with 10 additions and 1 deletions

View File

@@ -63,11 +63,17 @@ pub struct TCPSettings {
pub acceptProxyProtocol: Option<bool>, pub acceptProxyProtocol: Option<bool>,
} }
#[allow(non_snake_case)]
#[derive(Serialize, Deserialize)]
pub struct HeaderSetting {
pub Host: Option<String>,
}
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub struct WsSettings { pub struct WsSettings {
pub path: Option<String>, pub path: Option<String>,
// Headers map[string]string headers pub headers: Option<HeaderSetting>,
pub acceptProxyProtocol: Option<bool>, pub acceptProxyProtocol: Option<bool>,
} }

View File

@@ -28,6 +28,9 @@ pub fn create_outbound_object(data: models::VlessData) -> Outbound {
}, },
wsSettings: if data.query.r#type == String::from("ws") { wsSettings: if data.query.r#type == String::from("ws") {
Some(WsSettings { Some(WsSettings {
headers: Some(HeaderSetting {
Host: Some(data.query.host),
}),
path: Some(data.query.path), path: Some(data.query.path),
acceptProxyProtocol: None, acceptProxyProtocol: None,
}) })