Table of Contents

Class WsOptions

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll

Options for the WebSocket connection to the browser.

public class WsOptions
Inheritance
WsOptions

Fields

DefaultKeepAliveIntervalMs

Default ping period in milliseconds when KeepAlive is enabled.

public const int DefaultKeepAliveIntervalMs = 30000

Field Value

int

Properties

Headers

Headers to use for the web socket connection.

public Dictionary<string, string> Headers { get; set; }

Property Value

Dictionary<string, string>

KeepAlive

Whether to send WebSocket pings and drop the connection when a pong does not come back within the same interval. Detects a connection that died without a close frame, which otherwise leaves calls hanging until ProtocolTimeout.

public bool KeepAlive { get; set; }

Property Value

bool

Remarks

Dead-connection detection requires .NET 9 or later. On earlier runtimes, enabling keep-alive only configures the WebSocket keep-alive interval.

KeepAliveIntervalMs

Ping period in milliseconds. Only used when KeepAlive is set. Defaults to DefaultKeepAliveIntervalMs.

public int? KeepAliveIntervalMs { get; set; }

Property Value

int?