mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 15:07:53 +00:00
chore: create general outbound struct
This commit is contained in:
@@ -53,17 +53,23 @@ struct VlessOutboundSettings {
|
|||||||
vnext: Vec<VlessServerObject>,
|
vnext: Vec<VlessServerObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct VlessOutbound {
|
enum OutboundSettings {
|
||||||
settings: VlessOutboundSettings,
|
Vless(VlessOutboundSettings),
|
||||||
|
}
|
||||||
|
|
||||||
|
struct StreamSettings {}
|
||||||
|
|
||||||
|
pub struct Outbound {
|
||||||
|
settings: OutboundSettings,
|
||||||
protocol: String,
|
protocol: String,
|
||||||
tag: String,
|
tag: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_outbound_object(data: VlessData) -> VlessOutbound {
|
fn create_outbound_object(data: VlessData) -> Outbound {
|
||||||
return VlessOutbound {
|
return Outbound {
|
||||||
protocol: String::from("vless"),
|
protocol: String::from("vless"),
|
||||||
tag: String::from("proxy"),
|
tag: String::from("proxy"),
|
||||||
settings: VlessOutboundSettings {
|
settings: OutboundSettings::Vless(VlessOutboundSettings {
|
||||||
vnext: vec![VlessServerObject {
|
vnext: vec![VlessServerObject {
|
||||||
port: data.address_data.port,
|
port: data.address_data.port,
|
||||||
address: data.address_data.address,
|
address: data.address_data.address,
|
||||||
@@ -74,7 +80,7 @@ fn create_outbound_object(data: VlessData) -> VlessOutbound {
|
|||||||
level: 0,
|
level: 0,
|
||||||
}],
|
}],
|
||||||
}],
|
}],
|
||||||
},
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user