A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::net::HttpSseOptions Struct Reference

Endpoint paths and transport tuning for an HTTP SSE wire stream. More...

#include <cpp/a11/net/http_sse_wire_stream.h>

Public Member Functions

absl::Status Validate () const
 

Public Attributes

WireStreamOptions stream_options
 Per-stream buffering and deadline.
 
Http2Options http2_options
 Shared HTTP/2 transport and TLS policy.
 
std::string connect_endpoint
 SSE connect POST path.
 
std::string connect_endpoint_prefix
 Server-side: also accept a connect POST anywhere under this prefix.
 
std::string message_endpoint
 Outbound endpoint template.
 
SseOutboundDelivery outbound = SseOutboundDelivery::kPost
 Client-side outbound delivery method; servers accept either.
 
DescribeEndpointOptions describe
 Server-side: GET /actions, when something above filled in the handler.
 
bool accept_streamed_outbound = true
 Server-side: whether a streamed outbound request body is accepted, and so advertised in kSseOutboundModesHeader.
 
size_t max_concurrent_posts = 16
 Outbound POSTs a client keeps in flight at once (kPost only).
 
ServerHeaderOptions headers
 Server-side response-header policy: the Server header, cross-origin access, and the hints that tell a client and its intermediaries how to treat a reply.
 

Detailed Description

Endpoint paths and transport tuning for an HTTP SSE wire stream.

A POST to connect_endpoint opens the SSE event stream; message_endpoint (a path template containing the stream id) receives outbound messages, either one per POST or as one streamed request body. http2_options and stream_options tune the underlying transport.

Member Function Documentation

◆ Validate()

absl::Status a11::net::HttpSseOptions::Validate ( ) const
Returns
OK if the options are internally consistent.

Member Data Documentation

◆ accept_streamed_outbound

bool a11::net::HttpSseOptions::accept_streamed_outbound = true

Server-side: whether a streamed outbound request body is accepted, and so advertised in kSseOutboundModesHeader.

Clearing it leaves clients with POST-per-message – which is what an intermediary that will not carry a long-lived request body forces, and over HTTP/1.1 costs a connection per message.

◆ connect_endpoint

std::string a11::net::HttpSseOptions::connect_endpoint
Initial value:
=
constexpr std::string_view kDefaultSseConnectEndpoint
Default path on which a client opens the SSE event stream.
Definition http_sse_wire_stream.h:95

SSE connect POST path.

◆ connect_endpoint_prefix

std::string a11::net::HttpSseOptions::connect_endpoint_prefix

Server-side: also accept a connect POST anywhere under this prefix.

Empty by default, which serves exactly one endpoint. Set it to serve many on one port – one per agent, say – and read the rest of the path from HttpSseWireStream::GetRequestPath() in the on_connect handler. Must start and end with '/'. The message endpoint is unaffected: an outbound POST is correlated by the stream id it carries, not by its route.

◆ describe

DescribeEndpointOptions a11::net::HttpSseOptions::describe

Server-side: GET /actions, when something above filled in the handler.

See a11/net/describe_endpoint.h for why this is a callback.

◆ headers

ServerHeaderOptions a11::net::HttpSseOptions::headers

Server-side response-header policy: the Server header, cross-origin access, and the hints that tell a client and its intermediaries how to treat a reply.

Permissive by default, because a browser is a first-class A11 client. See a11/net/server_headers.h.

◆ http2_options

Http2Options a11::net::HttpSseOptions::http2_options

Shared HTTP/2 transport and TLS policy.

◆ max_concurrent_posts

size_t a11::net::HttpSseOptions::max_concurrent_posts = 16

Outbound POSTs a client keeps in flight at once (kPost only).

One restores the strictly serialised behaviour; the bound is what stops a fast producer from spending every stream on the HTTP/2 connection at once.

◆ message_endpoint

std::string a11::net::HttpSseOptions::message_endpoint
Initial value:
=
constexpr std::string_view kDefaultSseMessageEndpoint
Default message-post path template ({id} is the stream id).
Definition http_sse_wire_stream.h:97

Outbound endpoint template.

◆ outbound

SseOutboundDelivery a11::net::HttpSseOptions::outbound = SseOutboundDelivery::kPost

Client-side outbound delivery method; servers accept either.

◆ stream_options

WireStreamOptions a11::net::HttpSseOptions::stream_options

Per-stream buffering and deadline.


The documentation for this struct was generated from the following files: