mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-18 07:47:53 +00:00
Parse socks
This commit is contained in:
@@ -9,6 +9,12 @@ pub struct VnextUser {
|
||||
pub security: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct SocksUser {
|
||||
pub user: Option<String>,
|
||||
pub pass: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct VnextServerObject {
|
||||
pub address: Option<String>,
|
||||
@@ -33,6 +39,14 @@ pub struct ShadowSocksServerObject {
|
||||
pub method: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct SocksServerObject {
|
||||
pub address: Option<String>,
|
||||
pub port: Option<u16>,
|
||||
pub level: Option<u8>,
|
||||
pub users: Option<Vec<SocksUser>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct VlessOutboundSettings {
|
||||
pub vnext: Vec<VnextServerObject>,
|
||||
@@ -53,6 +67,11 @@ pub struct ShadowSocksOutboundSettings {
|
||||
pub servers: Vec<ShadowSocksServerObject>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct SocksOutboundSettings {
|
||||
pub servers: Vec<SocksServerObject>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum OutboundSettings {
|
||||
@@ -60,6 +79,7 @@ pub enum OutboundSettings {
|
||||
Vmess(VmessOutboundSettings),
|
||||
Trojan(TrojanOutboundSettings),
|
||||
ShadowSocks(ShadowSocksOutboundSettings),
|
||||
Socks(SocksOutboundSettings),
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@@ -243,4 +263,5 @@ pub struct RawData {
|
||||
pub address: Option<String>,
|
||||
pub port: Option<u16>,
|
||||
pub server_method: Option<String>,
|
||||
pub username: Option<String>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user