mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 08:01:26 +00:00
conf: support redirect outbound
This commit is contained in:
1 parent
028f294982
commit
d5da5035b0
1 file changed
+12
@@ -741,6 +741,18 @@ pub fn to_internal(conf: &mut Config) -> Result<internal::Config> {
|
||||
"direct" | "drop" => {
|
||||
outbounds.push(outbound);
|
||||
}
|
||||
"redirect" => {
|
||||
let mut settings = internal::RedirectOutboundSettings::new();
|
||||
if let Some(ext_address) = &ext_proxy.address {
|
||||
settings.address = ext_address.clone();
|
||||
}
|
||||
if let Some(ext_port) = &ext_proxy.port {
|
||||
settings.port = *ext_port as u32;
|
||||
}
|
||||
let settings = settings.write_to_bytes().unwrap();
|
||||
outbound.settings = settings;
|
||||
outbounds.push(outbound);
|
||||
}
|
||||
"socks" => {
|
||||
let mut settings = internal::SocksOutboundSettings::new();
|
||||
if let Some(ext_address) = &ext_proxy.address {
|
||||
|
||||
Reference in new issue
Block a user