Struct shadowsocks_service::local::redir::RedirBuilder
source · pub struct RedirBuilder { /* private fields */ }
Expand description
Transparent Proxy builder
Implementations§
source§impl RedirBuilder
impl RedirBuilder
sourcepub fn new(client_addr: ServerAddr, balancer: PingBalancer) -> RedirBuilder
pub fn new(client_addr: ServerAddr, balancer: PingBalancer) -> RedirBuilder
Create a new transparent proxy server with default configuration
sourcepub fn with_context(
context: Arc<ServiceContext>,
client_addr: ServerAddr,
balancer: PingBalancer
) -> RedirBuilder
pub fn with_context( context: Arc<ServiceContext>, client_addr: ServerAddr, balancer: PingBalancer ) -> RedirBuilder
Create a new transparent proxy server with context
sourcepub fn set_udp_expiry_duration(&mut self, d: Duration)
pub fn set_udp_expiry_duration(&mut self, d: Duration)
Set UDP association’s expiry duration
sourcepub fn set_udp_capacity(&mut self, c: usize)
pub fn set_udp_capacity(&mut self, c: usize)
Set total UDP association to be kept simultaneously in server
sourcepub fn set_tcp_redir(&mut self, ty: RedirType)
pub fn set_tcp_redir(&mut self, ty: RedirType)
Set transparent proxy type of TCP relay, which is platform dependent
sourcepub fn set_udp_redir(&mut self, ty: RedirType)
pub fn set_udp_redir(&mut self, ty: RedirType)
Set transparent proxy type of UDP relay, which is platform dependent
sourcepub fn set_udp_bind_addr(&mut self, addr: ServerAddr)
pub fn set_udp_bind_addr(&mut self, addr: ServerAddr)
Set UDP bind address
pub async fn build(self) -> Result<Redir>
Auto Trait Implementations§
impl Freeze for RedirBuilder
impl !RefUnwindSafe for RedirBuilder
impl Send for RedirBuilder
impl Sync for RedirBuilder
impl Unpin for RedirBuilder
impl !UnwindSafe for RedirBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more