mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 06:57:52 +00:00
Add headers for vless ws
This commit is contained in:
@@ -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>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user