53 std::uint16_t
port()
const;
54 std::string
url()
const;
55 const std::string&
token()
const;
69 std::unique_ptr<Impl> impl_;
ViewerServer(ServerOptions opts={})
Binds and starts the I/O thread. Throws std::runtime_error if the address cannot be bound.
std::string notice() const
What to tell the user when the viewer is reachable from the network ("" when it is not): who can see ...
Counters counters() const
std::uint16_t port() const
bound port (useful with port 0)
ViewerServer & operator=(const ViewerServer &)=delete
ViewerServer(const ViewerServer &)=delete
bool exposed() const
bound to an address other machines can reach
bool wants_transient() const override
True while at least one viewer is connected, so producers can skip building transient messages.
std::string url() const
http://<host or a LAN address>:<port>/ , with ?token=... when the viewer needs one
const std::string & token() const
"" = none required
void publish(std::string json) override
One JSON object per message (see the protocol document for the message types).
const std::string & web_root() const
std::size_t client_count() const
Event sink for live visualisation and replay (design doc 02 §7, protocol in docs/13-viewer-protocol....
std::string default_web_root()
Default directory of the built viewer: $TM_VIEW_DIR, else <prefix>/share/tracemaker/viewer for a bina...
std::string default_host()
Who can reach the viewer (issue #4, docs/09-visualization.md "Security", D116): by default only this ...
std::size_t max_clients
WebSocket viewers, counted from the upgrade on (a burst cannot overshoot); the next gets 503.
std::size_t max_queue_bytes
per client: same, by bytes
std::string web_root
directory with index.html; empty = <source dir>/viewer/dist
std::size_t max_queue_msgs
per client: beyond this, transient messages are dropped
std::size_t max_connections_per_address
of those, from one address: one host cannot use them all up before it has authenticated
std::size_t disconnect_bytes
per client: state backlog that drops the connection
std::string token
at least 16 characters of [A-Za-z0-9._~-]; empty = generated when the host is not a loopback address
std::string host
"0.0.0.0" or a LAN address makes the viewer reachable from the network: it then needs a token
bool allow_open
a non-loopback host without any token (–view-insecure)
std::string embed
pages that may frame the viewer, as CSP sources separated by spaces (–view-embed); empty = nobody (X-...
std::size_t max_connections
concurrent HTTP connections (a page load is one); beyond it a connection is closed at once
std::uint16_t port
0 = pick a free port (tests)
std::uint64_t clients_total