pub struct CreateSessionOptions {
pub profile_id: Option<String>,
pub recording: bool,
pub stealth: bool,
pub captcha: bool,
pub proxy: Option<ProxySpec>,
pub session_timeout_ms: Option<u64>,
pub timeout_seconds: Option<u32>,
pub keep_alive: bool,
pub user_metadata: Option<Map<String, Value>>,
}Expand description
Options accepted by POST /sessions.
Falsy fields are omitted from the request body; if every field is falsy the request is sent with no body at all.
Fields§
§profile_id: Option<String>Attach a stored browser profile (cookies + localStorage).
recording: boolEnable session recording. Off by default.
stealth: boolEnable the runtime stealth shim. Off by default.
captcha: boolEnable managed captcha solving. Requires stealth.
proxy: Option<ProxySpec>Request managed proxy egress. Requires stealth.
session_timeout_ms: Option<u64>End the session earlier than the plan maximum, in milliseconds. None
(or zero) leaves the plan maximum. The gateway counts whole seconds, so the
value is rounded up (1001 ms is 2 s), and it refuses anything under 60 s.
timeout_seconds: Option<u32>use session_timeout_ms; it wins when both are set
The same limit in seconds.
keep_alive: boolHold the session after the client disconnects, until its deadline
(session_timeout_ms, else an hour, never past the plan maximum) or until
it is released, so a dropped client can reconnect.
user_metadata: Option<Map<String, Value>>Free-form JSON stored with the session and returned by get and list.
Implementations§
Source§impl CreateSessionOptions
impl CreateSessionOptions
pub fn new() -> Self
pub fn profile_id(self, id: impl Into<String>) -> Self
pub fn recording(self, on: bool) -> Self
pub fn stealth(self, on: bool) -> Self
pub fn captcha(self, on: bool) -> Self
pub fn proxy(self, spec: impl Into<ProxySpec>) -> Self
Sourcepub fn session_timeout_ms(self, ms: u64) -> Self
pub fn session_timeout_ms(self, ms: u64) -> Self
Session lifetime in milliseconds; see CreateSessionOptions::session_timeout_ms.
Sourcepub fn timeout_seconds(self, seconds: u32) -> Self
👎Deprecated since 0.5.0: use session_timeout_ms
pub fn timeout_seconds(self, seconds: u32) -> Self
use session_timeout_ms
Session lifetime in seconds.