mirror of
https://github.com/TeamPiped/piped-proxy.git
synced 2024-08-14 23:50:45 +00:00
re-add compatibility with only UDS set
This commit is contained in:
parent
bf95377e9a
commit
70a167d34a
1 changed files with 6 additions and 3 deletions
|
@ -25,9 +25,12 @@ async fn main() -> std::io::Result<()> {
|
||||||
// match all requests
|
// match all requests
|
||||||
App::new().default_service(web::to(index))
|
App::new().default_service(web::to(index))
|
||||||
});
|
});
|
||||||
// get port from env
|
|
||||||
if let Ok(unix_socket) = env::var("BIND_UNIX") {
|
// get socket/port from env
|
||||||
server.bind_uds(unix_socket)?
|
// backwards compat when only UDS is set
|
||||||
|
let socket_path = env::var("BIND_UNIX").unwrap_or_else(|_| "./socket/actix.sock".to_string());
|
||||||
|
if env::var("UDS").is_ok() {
|
||||||
|
server.bind_uds(socket_path)?
|
||||||
} else {
|
} else {
|
||||||
let bind = env::var("BIND").unwrap_or_else(|_| "0.0.0.0:8080".to_string());
|
let bind = env::var("BIND").unwrap_or_else(|_| "0.0.0.0:8080".to_string());
|
||||||
server.bind(bind)?
|
server.bind(bind)?
|
||||||
|
|
Loading…
Reference in a new issue