Skip to main content

ClientConfig

Struct ClientConfig 

Source
pub struct ClientConfig {
Show 32 fields pub protocol_id: String, pub security: String, pub password: String, pub flow: String, pub reverse: Option<ClientReverse>, pub auth: String, pub private_key: String, pub public_key: String, pub allowed_ips: Vec<String>, pub allowed_ips_by_inbound: HashMap<i64, Vec<String>>, pub pre_shared_key: String, pub keep_alive: Option<i32>, pub forwarded_ports: String, pub secret: String, pub ad_tag: String, pub email: String, pub limit_ip: i32, pub limit_hwid: i32, pub total_gb: i64, pub expiry_time: i64, pub enable: bool, pub tg_id: i64, pub sub_id: String, pub group: String, pub comment: String, pub reset: i32, pub reset_day: i32, pub reset_max: i32, pub traffic_reset: Option<TrafficReset>, pub traffic_reset_day: i32, pub created_at: i64, pub updated_at: i64,
}
Expand description

Complete writable client configuration accepted by 3x-ui.

Protocol-specific credentials may be left empty on create; 3x-ui generates the appropriate UUID, password, auth value, or MTProto secret from the target inbound. Use ClientRecord::to_config before replacement updates.

Fields§

§protocol_id: String

VMess/VLESS UUID.

§security: String

Protocol security method.

§password: String

Trojan or Shadowsocks password/key.

§flow: String

XTLS flow value.

§reverse: Option<ClientReverse>

VLESS reverse-proxy settings.

§auth: String

Hysteria authentication value.

§private_key: String

WireGuard private key.

§public_key: String

WireGuard public key.

§allowed_ips: Vec<String>

WireGuard allowed networks.

§allowed_ips_by_inbound: HashMap<i64, Vec<String>>

Per-inbound WireGuard/AmneziaWG allowed-network overrides.

§pre_shared_key: String

WireGuard pre-shared key.

§keep_alive: Option<i32>

WireGuard keepalive seconds: None preserves the stored value; Some(0) disables it.

§forwarded_ports: String

AmneziaWG per-client port-forwarding specification.

§secret: String

MTProto client secret.

§ad_tag: String

MTProto advertisement tag.

§email: String

Unique client email/name.

§limit_ip: i32

Maximum concurrent source IP count.

§limit_hwid: i32

Maximum registered subscription devices; zero disables HWID limiting.

§total_gb: i64

Traffic quota in bytes, despite the historical totalGB wire name.

§expiry_time: i64

Expiration timestamp in milliseconds; zero means unlimited.

§enable: bool

Whether the client is enabled.

§tg_id: i64

Telegram user identifier for notifications.

§sub_id: String

Subscription identifier.

§group: String

Optional logical group label.

§comment: String

Operator comment.

§reset: i32

Automatic reset period encoded by 3x-ui.

§reset_day: i32

Calendar renewal day; zero keeps interval-based renewal.

§reset_max: i32

Maximum automatic renewals; zero is unlimited.

§traffic_reset: Option<TrafficReset>

Independent per-client traffic reset cycle.

§traffic_reset_day: i32

Day of month used by the per-client monthly reset cycle.

§created_at: i64

Creation timestamp in milliseconds used by import/export.

§updated_at: i64

Update timestamp in milliseconds used by import/export.

Implementations§

Source§

impl ClientConfig

Source

pub fn new(email: impl Into<String>) -> Self

Creates an enabled, unlimited client and lets 3x-ui generate credentials.

Trait Implementations§

Source§

impl Clone for ClientConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientConfig

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClientConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ClientConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ClientConfig

Source§

impl PartialEq for ClientConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ClientConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ClientConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more