|
|
@ -256,8 +256,8 @@ fn upgrade_ws_or_serve_app( |
|
|
|
Err(make_error(StatusCode::FORBIDDEN)) |
|
|
|
Err(make_error(StatusCode::FORBIDDEN)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const LOCAL_HOSTS: [&str; 3] = ["localhost", "127.0.0.1", "::1"]; |
|
|
|
const LOCAL_HOSTS: [&str; 3] = ["localhost", "127.0.0.1", "[::1]"]; |
|
|
|
const LOCAL_URLS: [&str; 3] = ["http://localhost", "http://127.0.0.1", "http://::1"]; |
|
|
|
const LOCAL_URLS: [&str; 3] = ["http://localhost", "http://127.0.0.1", "http://[::1]"]; |
|
|
|
const APP_NG_ONE_URL: &str = "https://app.nextgraph.one"; |
|
|
|
const APP_NG_ONE_URL: &str = "https://app.nextgraph.one"; |
|
|
|
|
|
|
|
|
|
|
|
impl Callback for SecurityCallback { |
|
|
|
impl Callback for SecurityCallback { |
|
|
@ -743,7 +743,9 @@ pub async fn run_server_v0( |
|
|
|
.map(SocketAddr::to_string) |
|
|
|
.map(SocketAddr::to_string) |
|
|
|
.collect::<Vec<String>>() |
|
|
|
.collect::<Vec<String>>() |
|
|
|
.join(", "); |
|
|
|
.join(", "); |
|
|
|
let tcp_listener = TcpListener::bind(addrs.0.as_slice()).await.map_err(|e| { |
|
|
|
|
|
|
|
|
|
|
|
for addr in addrs.0 { |
|
|
|
|
|
|
|
let tcp_listener = TcpListener::bind(addr).await.map_err(|e| { |
|
|
|
log_err!( |
|
|
|
log_err!( |
|
|
|
"cannot bind to {} with addresses {} : {}", |
|
|
|
"cannot bind to {} with addresses {} : {}", |
|
|
|
addrs.1, |
|
|
|
addrs.1, |
|
|
@ -751,11 +753,12 @@ pub async fn run_server_v0( |
|
|
|
e.to_string() |
|
|
|
e.to_string() |
|
|
|
) |
|
|
|
) |
|
|
|
})?; |
|
|
|
})?; |
|
|
|
log_info!("Listening on {} {}", addrs.1, addrs_string); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listeners.push(tcp_listener); |
|
|
|
listeners.push(tcp_listener); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log_info!("Listening on {} {}", addrs.1, addrs_string); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// select on all listeners
|
|
|
|
// select on all listeners
|
|
|
|
let mut incoming = futures::stream::select_all( |
|
|
|
let mut incoming = futures::stream::select_all( |
|
|
|
listeners |
|
|
|
listeners |
|
|
|