pub struct ProxyClientConfig {
pub proxy_url: String,
pub identity_keypair: Option<IdentityKeyPair>,
}Expand description
Configuration for creating a proxy client.
§Examples
Create a client with a new identity:
use ap_proxy_client::ProxyClientConfig;
let config = ProxyClientConfig {
proxy_url: "ws://localhost:8080".to_string(),
identity_keypair: None, // Will generate a new identity
};Create a client with an existing identity:
use ap_proxy_client::{ProxyClientConfig, IdentityKeyPair};
let keypair = IdentityKeyPair::generate();
let config = ProxyClientConfig {
proxy_url: "ws://localhost:8080".to_string(),
identity_keypair: Some(keypair),
};Fields§
§proxy_url: StringWebSocket URL of the proxy server.
Format: ws://host:port or wss://host:port for TLS.
§Examples
"ws://localhost:8080"- Local development"wss://proxy.example.com:443"- Production with TLS
identity_keypair: Option<IdentityKeyPair>Optional identity keypair.
If None, a new random identity will be generated on each connection.
If Some, the provided identity will be used for authentication.
Use IdentityKeyPair::generate() to create a new identity, or
[IdentityKeyPair::from_seed()] to restore a previously saved identity.
Auto Trait Implementations§
impl Freeze for ProxyClientConfig
impl RefUnwindSafe for ProxyClientConfig
impl Send for ProxyClientConfig
impl Sync for ProxyClientConfig
impl Unpin for ProxyClientConfig
impl UnsafeUnpin for ProxyClientConfig
impl UnwindSafe for ProxyClientConfig
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