WsOptions
Namespace: PuppeteerSharp
public class WsOptionsOptions for the WebSocket connection to the browser.
Inheritance: object
Fields
Section titled “Fields”DefaultKeepAliveIntervalMs
Section titled “DefaultKeepAliveIntervalMs”public const int DefaultKeepAliveIntervalMs = 30000Default ping period in milliseconds when KeepAlive is enabled.
Value: int
Properties
Section titled “Properties”HandshakeTimeout
Section titled “HandshakeTimeout”public int? HandshakeTimeout { get; set; }Time in milliseconds to wait for the WebSocket opening handshake before failing. Without it, connecting to a host that accepts the TCP connection but never answers the upgrade request waits until the operating system gives up.
Value: int?
Headers
Section titled “Headers”public Dictionary<string, string> Headers { get; set; }Headers to use for the web socket connection.
Value: Dictionary<string, string>
KeepAlive
Section titled “KeepAlive”public bool KeepAlive { get; set; }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.
Value: bool
Dead-connection detection requires .NET 9 or later. On earlier runtimes, enabling keep-alive only configures the WebSocket keep-alive interval.
KeepAliveIntervalMs
Section titled “KeepAliveIntervalMs”public int? KeepAliveIntervalMs { get; set; }Ping period in milliseconds. Only used when KeepAlive is set. Defaults to DefaultKeepAliveIntervalMs.
Value: int?
Made with love by Dario Kondratiuk