pub struct Obfuscator { /* private fields */ }Expand description
Traffic obfuscator — wraps and unwraps VCL packets.
Implementations§
Source§impl Obfuscator
impl Obfuscator
Sourcepub fn new(config: ObfuscationConfig) -> Self
pub fn new(config: ObfuscationConfig) -> Self
Create a new obfuscator with the given config.
Sourcepub fn deobfuscate(&mut self, data: &[u8]) -> Result<Vec<u8>, VCLError>
pub fn deobfuscate(&mut self, data: &[u8]) -> Result<Vec<u8>, VCLError>
Deobfuscate a received packet back to raw VCL data.
Sourcepub fn jitter_ms(&self) -> u64
pub fn jitter_ms(&self) -> u64
Returns the jitter delay in milliseconds to wait before sending.
Sourcepub fn overhead_ratio(&self) -> f64
pub fn overhead_ratio(&self) -> f64
Returns the overhead ratio: overhead_bytes / original_bytes.
Sourcepub fn total_obfuscated(&self) -> u64
pub fn total_obfuscated(&self) -> u64
Returns total bytes of original data obfuscated.
Sourcepub fn total_overhead(&self) -> u64
pub fn total_overhead(&self) -> u64
Returns total overhead bytes added.
Sourcepub fn config(&self) -> &ObfuscationConfig
pub fn config(&self) -> &ObfuscationConfig
Returns a reference to the config.
Sourcepub fn mode(&self) -> &ObfuscationMode
pub fn mode(&self) -> &ObfuscationMode
Returns the current obfuscation mode.
Auto Trait Implementations§
impl Freeze for Obfuscator
impl RefUnwindSafe for Obfuscator
impl Send for Obfuscator
impl Sync for Obfuscator
impl Unpin for Obfuscator
impl UnsafeUnpin for Obfuscator
impl UnwindSafe for Obfuscator
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