pub struct ServerOptions {Show 13 fields
pub bind: SocketAddr,
pub snapshot_rx: Receiver<ViewerSnapshot>,
pub conversation_rx: Receiver<BTreeMap<String, BrowserTranscript>>,
pub action_tx: Sender<ControllerRequest>,
pub bundle_tx: Sender<BundleRequest>,
pub receipt_tx: Sender<ReadReceiptRequest>,
pub preflight_tx: Sender<PreflightRequest>,
pub move_preparation_tx: Sender<MovePreparationRequest>,
pub client_state_tx: Sender<ClientStateRequest>,
pub dictation_tx: Sender<DictationRequest>,
pub shutdown: CancellationToken,
pub session_ttl: Duration,
pub secure_cookie: bool,
/* private fields */
}Expand description
Options for the daemon’s phone service.
ServerOptions::new generates both the six-digit viewer code and an
ephemeral cookie key. A caller that wants cookies to survive server
restarts installs a persisted key with set_cookie_key, which
load_or_create_cookie_key reads from its private Hel data directory. The
key and viewer code are intentionally omitted from Debug output.
Fields§
§bind: SocketAddr§snapshot_rx: Receiver<ViewerSnapshot>§conversation_rx: Receiver<BTreeMap<String, BrowserTranscript>>§action_tx: Sender<ControllerRequest>§bundle_tx: Sender<BundleRequest>§receipt_tx: Sender<ReadReceiptRequest>§preflight_tx: Sender<PreflightRequest>§move_preparation_tx: Sender<MovePreparationRequest>§client_state_tx: Sender<ClientStateRequest>§dictation_tx: Sender<DictationRequest>§shutdown: CancellationToken§session_ttl: DurationKeep this enabled for direct HTTPS or an HTTPS reverse proxy. It may be disabled only for an explicitly trusted HTTP development endpoint.
Implementations§
Source§impl ServerOptions
impl ServerOptions
pub fn new( bind: SocketAddr, snapshot_rx: Receiver<ViewerSnapshot>, conversation_rx: Receiver<BTreeMap<String, BrowserTranscript>>, requests: ServerRequests, ) -> AnyResult<Self>
pub fn viewer_code(&self) -> &str
pub fn login_token(&self) -> &str
Sourcepub fn set_tls_config(&mut self, config: RustlsConfig)
pub fn set_tls_config(&mut self, config: RustlsConfig)
Serve HTTPS directly using the supplied Rustls configuration. Hel’s CLI can load its persisted certificate (including a Tailscale-issued certificate) and pass it here without coupling this module to disk.
Install a persisted signing key. Rotating this value signs every phone out without maintaining a server-side session database.
Trait Implementations§
Source§impl Clone for ServerOptions
impl Clone for ServerOptions
Source§fn clone(&self) -> ServerOptions
fn clone(&self) -> ServerOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ServerOptions
impl !UnwindSafe for ServerOptions
impl Freeze for ServerOptions
impl Send for ServerOptions
impl Sync for ServerOptions
impl Unpin for ServerOptions
impl UnsafeUnpin for ServerOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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