Rename Upstream::Custom to Upstream::Proxy

And CustomUpstream to ProxyToUpstream.

Signed-off-by: Jacob Kiers <code@kiers.eu>
This commit is contained in:
2023-10-04 22:10:28 +02:00
parent 2651ec1f4a
commit a574163aef
2 changed files with 9 additions and 9 deletions

View File

@@ -94,13 +94,13 @@ async fn process(
let bytes_tx = inbound_to_inbound.await;
debug!("Bytes read: {:?}", bytes_tx);
}
Upstream::Custom(custom) => {
let outbound = match custom.protocol.as_ref() {
Upstream::Proxy(config) => {
let outbound = match config.protocol.as_ref() {
"tcp4" | "tcp6" | "tcp" => {
TcpStream::connect(custom.resolve_addresses().await?.as_slice()).await?
TcpStream::connect(config.resolve_addresses().await?.as_slice()).await?
}
_ => {
error!("Reached unknown protocol: {:?}", custom.protocol);
error!("Reached unknown protocol: {:?}", config.protocol);
return Err("Reached unknown protocol".into());
}
};