mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-18 07:47:53 +00:00
Parse shadowsocks
This commit is contained in:
@@ -24,6 +24,15 @@ pub struct TrojanServerObject {
|
||||
pub level: Option<u8>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ShadowSocksServerObject {
|
||||
pub address: Option<String>,
|
||||
pub port: Option<u16>,
|
||||
pub password: Option<String>,
|
||||
pub level: Option<u8>,
|
||||
pub method: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct VlessOutboundSettings {
|
||||
pub vnext: Vec<VnextServerObject>,
|
||||
@@ -39,12 +48,18 @@ pub struct TrojanOutboundSettings {
|
||||
pub servers: Vec<TrojanServerObject>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ShadowSocksOutboundSettings {
|
||||
pub servers: Vec<ShadowSocksServerObject>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum OutboundSettings {
|
||||
Vless(VlessOutboundSettings),
|
||||
Vmess(VmessOutboundSettings),
|
||||
Trojan(TrojanOutboundSettings),
|
||||
ShadowSocks(ShadowSocksOutboundSettings),
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@@ -227,4 +242,5 @@ pub struct RawData {
|
||||
pub uuid: Option<String>,
|
||||
pub address: Option<String>,
|
||||
pub port: Option<u16>,
|
||||
pub server_method: Option<String>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user