generalize node holder connection
This commit is contained in:
parent
7ea43b101d
commit
3e2dc9099a
7 changed files with 30 additions and 31 deletions
|
|
@ -10,6 +10,7 @@ prudpv1 = { path = "../prudpv1", optional = true }
|
|||
proxy-common = { path = "../proxy-common" }
|
||||
cfg-if = "1.0.4"
|
||||
rnex-core = { path = "../rnex-core", version = "0.1.1" }
|
||||
log = "0.4.25"
|
||||
|
||||
[features]
|
||||
prudpv0 = ["dep:prudpv0"]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
use proxy_common::ProxyStartupParam;
|
||||
use std::process::abort;
|
||||
|
||||
use proxy::edge_node_dc_callback;
|
||||
use proxy_common::{ProxyStartupParam, setup_edge_node_connection};
|
||||
use rnex_core::common::setup;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
setup();
|
||||
|
||||
proxy::start_insecure(
|
||||
ProxyStartupParam::new(proxy_common::ProxyType::Insecure)
|
||||
.expect("unable to get startup parameters"),
|
||||
)
|
||||
.await;
|
||||
let param = ProxyStartupParam::new(proxy_common::ProxyType::Insecure)
|
||||
.expect("unable to get startup parameters");
|
||||
|
||||
setup_edge_node_connection(¶m, edge_node_dc_callback).await;
|
||||
|
||||
proxy::start_insecure(param).await;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
use std::process::abort;
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use log::error;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "prudpv0")]{
|
||||
|
|
@ -9,3 +12,8 @@ cfg_if! {
|
|||
compile_error!("no proxy type has been set");
|
||||
}
|
||||
}
|
||||
|
||||
pub fn edge_node_dc_callback() {
|
||||
error!("disconnected from node holder, aborting!");
|
||||
abort()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
use proxy_common::ProxyStartupParam;
|
||||
use proxy::edge_node_dc_callback;
|
||||
use proxy_common::{ProxyStartupParam, setup_edge_node_connection};
|
||||
use rnex_core::common::setup;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
setup();
|
||||
proxy::start_secure(
|
||||
ProxyStartupParam::new(proxy_common::ProxyType::Secure)
|
||||
.expect("unable to get startup parameters"),
|
||||
)
|
||||
.await;
|
||||
|
||||
let param = ProxyStartupParam::new(proxy_common::ProxyType::Secure)
|
||||
.expect("unable to get startup parameters");
|
||||
|
||||
setup_edge_node_connection(¶m, edge_node_dc_callback).await;
|
||||
proxy::start_secure(param).await;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue