|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
ACP over Streamable HTTP and WebSocket; see the file comment for the mapping, the deviations from the draft and the security rules. More...
#include <http_server.h>
Public Types | |
| using | ConnectionFactory = std::function< ACPHttpConnection(std::string_view principal)> |
| Called once per new connection, with the principal the authenticator returned (empty without one). It must return a fresh ACPServer; it may be called on any HTTP thread and concurrently. | |
Public Member Functions | |
| ACPHttpServer (ConnectionFactory factory, ACPHttpConfig config={}) | |
| void | attach_client (std::shared_ptr< ACPClient > client) |
Bind a client that graph nodes captured before this server existed, as ACPServer::attach_client does for one connection: an unbound std::make_shared<ACPClient>() is captured when the engine is compiled and attached here once the server is built. | |
| std::shared_ptr< ACPClient > | client () |
| A handle for agent-to-client requests (fs/*, permission) that reaches the connection owning the session named in each call, so graph nodes can capture it once, before any connection exists. A call for a session that no live connection holds throws std::runtime_error. | |
| std::size_t | connection_count () const |
| The number of open connections. | |
| int | port () const |
| The bound port; useful when ACPHttpConfig::port is 0. | |
| bool | start () |
| Bind and serve until stop() is called. Returns false if the address cannot be bound. | |
| bool | start_async () |
| Bind and serve on a background listener thread. | |
| void | stop () |
| Stop accepting, close every connection (cancelling its prompts) and join the threads. The connections' ACPServers are destroyed here. | |
ACP over Streamable HTTP and WebSocket; see the file comment for the mapping, the deviations from the draft and the security rules.
Definition at line 245 of file http_server.h.
| neograph::acp::ACPHttpServer::ACPHttpServer | ( | ConnectionFactory | factory, |
| ACPHttpConfig | config = {} |
||
| ) |
| std::invalid_argument | for a missing factory, an invalid limit or endpoint, an allowed_hosts entry that is not a host name without a port, an IPv6 address in brackets or *, a remote bind without authenticator, or no transport enabled. |