mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2026-11-08 18:38:50 +00:00
Parse shadowsocks
This commit is contained in:
1 parent
cbe39f008e
commit
574c3807f3
8 files changed
+122
-2
No files matched your search
@@ -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