#include <http_server.hpp>
◆ HttpServer() [1/3]
| plotly::detail::HttpServer::HttpServer |
( |
const std::filesystem::path & | directory | ) |
|
|
explicit |
Construct a server serving files from a directory.
- Parameters
-
| directory | Path to the directory containing files to serve |
◆ ~HttpServer()
| plotly::detail::HttpServer::~HttpServer |
( |
| ) |
|
◆ HttpServer() [2/3]
| plotly::detail::HttpServer::HttpServer |
( |
const HttpServer & | | ) |
|
|
delete |
◆ HttpServer() [3/3]
| plotly::detail::HttpServer::HttpServer |
( |
HttpServer && | | ) |
|
|
delete |
◆ getPort()
| auto plotly::detail::HttpServer::getPort |
( |
| ) |
const -> int |
|
nodiscardnoexcept |
Get the port number the server is running on.
- Returns
- The port number
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setWebsocketPortRequestHandler()
| void plotly::detail::HttpServer::setWebsocketPortRequestHandler |
( |
int | wsPort | ) |
|
Configure the server to respond with a specific WebSocket port.
- Parameters
-
| wsPort | The WebSocket port to report |
Sets up an endpoint that responds to WebSocket port requests with the specified port number. This is used for WebSocket communication between the browser and the application.
◆ start()
| void plotly::detail::HttpServer::start |
( |
| ) |
|
Start the HTTP server.
This method starts the HTTP server on a randomly allocated port. The server runs in a background thread.
◆ stop()
| void plotly::detail::HttpServer::stop |
( |
| ) |
|
Stop the HTTP server.
This method stops the HTTP server and joins the server thread.
The documentation for this class was generated from the following files: