Skip to content

Commit

Permalink
fixup! tproxy: allow to specify hostname for upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
nikicat committed Jun 1, 2024
1 parent e8278e3 commit 5bacd21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions roles/translator/src/lib/proxy_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use serde::Deserialize;
#[derive(Debug, Deserialize, Clone)]
pub struct ProxyConfig {
pub upstream_address: String,
pub upstream_port: u16,
pub upstream_authority_pubkey: Secp256k1PublicKey,
pub downstream_address: String,
pub downstream_port: u16,
Expand Down
7 changes: 3 additions & 4 deletions roles/translator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ async fn main() {
) = broadcast::channel(10);

// Format `Upstream` connection address
let upstream_addr = proxy_config
.upstream_address
let upstream_addr = (proxy_config.upstream_address.as_str(), proxy_config.upstream_port)
.to_socket_addrs()
.unwrap_or_else(|e| {
panic!(
"Invalid upstream address {}: {}",
proxy_config.upstream_address, e
"Invalid upstream address {}:{}: {}",
proxy_config.upstream_address, proxy_config.upstream_port, e
)
})
.next()
Expand Down

0 comments on commit 5bacd21

Please sign in to comment.