data SseConfig
Settings of SseStream.open.
Example:
use std.http { SseConfig }
fn main() io {
// reconnect by itself, at most 5 failed attempts in a row, 1 s between them until the server says otherwise
let cfg = SseConfig{ reconnect: true, maxReconnects: 5, retryDefault: 1s }
print("{cfg.maxReconnects}")
}5
pub(api) data SseConfigSince. 1.0.0-beta
Fields
pub(api) timeout: Duration? = none | Bound for connecting and receiving the response head (not for the events). |
pub(api) lastEventId: str = "" |
|
pub(api) reconnect: bool = false | Reconnect by itself when the stream ends or breaks (WHATWG): after the retry delay the request is repeated with |
pub(api) retryDefault: Duration = 3s | Delay before a reconnect until the server sends a |
pub(api) maxReconnects: i64 = -1 | Failed reconnect attempts in a row before giving up; -1 = never. |
pub(api) ca: str = "" | https: file with the certificate authorities to trust. |
pub(api) caPem: str = "" | https: trust anchors as PEM text. |
pub(api) insecureSkipVerify: bool = false | https: skip certificate verification (tests only). |
pub(api) verifyHostname: bool = true | https: check that the certificate names the host. |
Defined in: std/http/http.oxl:4738