pub mod artifact;
pub mod client;
pub mod forward;
pub mod netstack;
pub mod probe;
use std::time::Duration;
#[derive(Debug, thiserror::Error)]
pub enum EdgeError {
#[error("edge artifact error: {0}")]
Artifact(String),
#[error("edge token error: {0}")]
Token(#[from] zlayer_types::overlayd::EdgeTokenError),
#[error("edge netstack error: {0}")]
Netstack(String),
#[error("edge connect error: {0}")]
Connect(String),
#[error("edge forward error: {0}")]
Forward(String),
#[error("edge probe error: {0}")]
Probe(String),
#[error(transparent)]
Overlay(#[from] crate::OverlayError),
#[error(transparent)]
Io(#[from] std::io::Error),
}
pub const EDGE_TCP_BUFFER_BYTES: usize = 256 * 1024;
pub const EDGE_TCP_TIMEOUT: Duration = Duration::from_secs(60);
pub const EDGE_HANDSHAKE_GRACE: Duration = Duration::from_secs(30);
pub const EDGE_HANDSHAKE_STALE: Duration = Duration::from_secs(180);
pub const EDGE_BACKOFF_MAX: Duration = Duration::from_secs(60);
pub const EDGE_EPHEMERAL_PORT_START: u16 = 49152;
pub struct TcpConn {
pub tx: tokio::sync::mpsc::Sender<Vec<u8>>,
pub rx: tokio::sync::mpsc::Receiver<Vec<u8>>,
}