WebSocket.Options
Options applied when the socket is opened.
Headers, cookies, compression and verify_certificate are only used when the backend supports them, see WebSocket.Capabilities.
Fields
| Name | Type | Description |
|---|---|---|
headers | table<string, string> | nil | Extra handshake headers (Capabilities.headers). |
cookies | http.CookieJar | nil | Cookie jar; matching cookies are sent in the Cookie header (Capabilities.headers). |
verify_certificate | boolean | nil | Verify the TLS certificate (Capabilities.verify_certificate). Defaults to true. |
compression | boolean | nil | Negotiate permessage-deflate (Capabilities.compression). |
reconnect | boolean | WebSocket.ReconnectOptions | nil | Reconnect after the connection is lost or fails, true uses the defaults. Never after a local close. |
close_timeout | number | nil | Seconds a graceful close may take before the socket is terminated. Defaults to 5. |