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

Listen address, path, and per-stream defaults for a WebSocketWireServer. More...

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

Public Member Functions

absl::Status Validate () const
 

Public Attributes

std::string path = "/a11"
 Exact WebSocket endpoint path.
 
std::string path_prefix
 Also accept anything under this prefix, as well as path.
 
std::string bind_address = "127.0.0.1"
 Local listen address.
 
std::uint16_t port = 0
 Listen port; zero requests an ephemeral port.
 
WireStreamOptions stream_options
 Defaults for accepted streams.
 
ChannelFramingOptions framing
 Framing for accepted streams.
 
Http2Options http2_options
 Server HTTP/2 and TLS policy.
 
DescribeEndpointOptions describe
 GET /actions on this same port, when something above filled in the handler.
 
ServerHeaderOptions headers
 Response-header policy for this port's HTTP surface – the Server header, cross-origin access and cache hints.
 

Detailed Description

Listen address, path, and per-stream defaults for a WebSocketWireServer.

A port of 0 requests an ephemeral port. stream_options and framing are applied to each accepted stream; http2_options carries transport and TLS settings.

Member Function Documentation

◆ Validate()

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

Member Data Documentation

◆ bind_address

std::string a11::net::WebSocketServerOptions::bind_address = "127.0.0.1"

Local listen address.

◆ describe

DescribeEndpointOptions a11::net::WebSocketServerOptions::describe

GET /actions on this same port, when something above filled in the handler.

A WebSocket client can ask __list_actions__ over the stream it already has; this is for whoever has only the port number. See a11/net/describe_endpoint.h.

◆ framing

ChannelFramingOptions a11::net::WebSocketServerOptions::framing

Framing for accepted streams.

◆ headers

ServerHeaderOptions a11::net::WebSocketServerOptions::headers

Response-header policy for this port's HTTP surface – the Server header, cross-origin access and cache hints.

It has one even though its business is upgrades: a 404 and a GET /actions are ordinary HTTP responses, and a browser reading either needs the same headers as it does from the SSE port. See a11/net/server_headers.h.

◆ http2_options

Http2Options a11::net::WebSocketServerOptions::http2_options

Server HTTP/2 and TLS policy.

◆ path

std::string a11::net::WebSocketServerOptions::path = "/a11"

Exact WebSocket endpoint path.

◆ path_prefix

std::string a11::net::WebSocketServerOptions::path_prefix

Also accept anything under this prefix, as well as path.

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 WebSocketWireStream::GetRequestPath() in the on_stream handler. Must start and end with '/'.

◆ port

std::uint16_t a11::net::WebSocketServerOptions::port = 0

Listen port; zero requests an ephemeral port.

◆ stream_options

WireStreamOptions a11::net::WebSocketServerOptions::stream_options

Defaults for accepted streams.


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