pub struct JlsServerConfig {
pub enable: bool,
pub users: Vec<JlsUser>,
pub upstream_addr: Option<String>,
pub upstream_sni: Option<String>,
pub rate_limit: u64,
}Expand description
Jls Server Configuration
Fields§
§enable: boolenable JLS or a fall back to normal TLS
users: Vec<JlsUser>Jls password and iv
upstream_addr: Option<String>upstream address, for example, example.com:443 If empty, forwarding will be disabled
upstream_sni: Option<String>server name for upstream, if empty, server name check will be skipped
rate_limit: u64Limit the rate of JLS forwarding This is not done in rustls but in quinn or tokio-rustls
Implementations§
Source§impl JlsServerConfig
impl JlsServerConfig
Sourcepub fn new(
pwd: String,
iv: String,
upstream_addr: Option<String>,
upstream_sni: Option<String>,
) -> Self
pub fn new( pwd: String, iv: String, upstream_addr: Option<String>, upstream_sni: Option<String>, ) -> Self
Create a new jls server configuration
Sourcepub fn with_upstream_addr(self, addr: String) -> Self
pub fn with_upstream_addr(self, addr: String) -> Self
setting upstream address and get default server name if viable
Sourcepub fn with_server_name(self, server_name: String) -> Self
pub fn with_server_name(self, server_name: String) -> Self
setting server name authentication check
Sourcepub fn with_rate_limit(self, rate_limit: u64) -> Self
pub fn with_rate_limit(self, rate_limit: u64) -> Self
setting rate limit for JLS forwarding
Trait Implementations§
Source§impl Clone for JlsServerConfig
impl Clone for JlsServerConfig
Source§fn clone(&self) -> JlsServerConfig
fn clone(&self) -> JlsServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JlsServerConfig
impl Debug for JlsServerConfig
Source§impl Default for JlsServerConfig
impl Default for JlsServerConfig
Source§fn default() -> JlsServerConfig
fn default() -> JlsServerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JlsServerConfig
impl RefUnwindSafe for JlsServerConfig
impl Send for JlsServerConfig
impl Sync for JlsServerConfig
impl Unpin for JlsServerConfig
impl UnsafeUnpin for JlsServerConfig
impl UnwindSafe for JlsServerConfig
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