chore: create general outbound struct

This commit is contained in:
Keivan-sf
2023-10-14 11:30:03 +03:30
parent 2f9005f1e4
commit e286d1c499

View File

@@ -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,
}], }],
}], }],
}, }),
}; };
} }