|
| WSSServer (const WSSServer &)=delete |
|
| WSSServer (WSSServer &&)=delete |
|
virtual | ~WSSServer ()=default |
|
WSSServer & | operator= (const WSSServer &)=delete |
|
WSSServer & | operator= (WSSServer &&)=delete |
|
virtual bool | CloseAll () |
|
virtual bool | CloseAll (int status) |
|
virtual bool | CloseAll (int status, const void *buffer, size_t size) |
|
virtual bool | CloseAll (int status, std::string_view text) |
|
bool | Multicast (const void *buffer, size_t size) override |
| Multicast data to all connected WebSocket sessions. More...
|
|
size_t | MulticastText (const void *buffer, size_t size) |
|
size_t | MulticastText (std::string_view text) |
|
size_t | MulticastBinary (const void *buffer, size_t size) |
|
size_t | MulticastBinary (std::string_view text) |
|
size_t | MulticastPing (const void *buffer, size_t size) |
|
size_t | MulticastPing (std::string_view text) |
|
| HTTPSServer (const HTTPSServer &)=delete |
|
| HTTPSServer (HTTPSServer &&)=delete |
|
virtual | ~HTTPSServer ()=default |
|
HTTPSServer & | operator= (const HTTPSServer &)=delete |
|
HTTPSServer & | operator= (HTTPSServer &&)=delete |
|
CppCommon::FileCache & | cache () noexcept |
| Get the static content cache. More...
|
|
const CppCommon::FileCache & | cache () const noexcept |
|
void | AddStaticContent (const CppCommon::Path &path, const std::string &prefix="/", const CppCommon::Timespan &timeout=CppCommon::Timespan::hours(1)) |
| Add static content cache. More...
|
|
void | RemoveStaticContent (const CppCommon::Path &path) |
| Remove static content cache. More...
|
|
void | ClearStaticContent () |
| Clear static content cache. More...
|
|
void | Watchdog (const CppCommon::UtcTimestamp &utc=CppCommon::UtcTimestamp()) |
| Watchdog the static content cache. More...
|
|
| SSLServer (const std::shared_ptr< Service > &service, const std::shared_ptr< SSLContext > &context, int port, InternetProtocol protocol=InternetProtocol::IPv4) |
| Initialize SSL server with a given Asio service, SSL context and port number. More...
|
|
| SSLServer (const std::shared_ptr< Service > &service, const std::shared_ptr< SSLContext > &context, const std::string &address, int port) |
| Initialize SSL server with a given Asio service, SSL context, server address and port number. More...
|
|
| SSLServer (const std::shared_ptr< Service > &service, const std::shared_ptr< SSLContext > &context, const asio::ip::tcp::endpoint &endpoint) |
| Initialize SSL server with a given a given Asio service, SSL context and endpoint. More...
|
|
| SSLServer (const SSLServer &)=delete |
|
| SSLServer (SSLServer &&)=delete |
|
virtual | ~SSLServer ()=default |
|
SSLServer & | operator= (const SSLServer &)=delete |
|
SSLServer & | operator= (SSLServer &&)=delete |
|
const CppCommon::UUID & | id () const noexcept |
| Get the server Id. More...
|
|
std::shared_ptr< Service > & | service () noexcept |
| Get the Asio service. More...
|
|
std::shared_ptr< asio::io_service > & | io_service () noexcept |
| Get the Asio IO service. More...
|
|
asio::io_service::strand & | strand () noexcept |
| Get the Asio service strand for serialized handler execution. More...
|
|
std::shared_ptr< SSLContext > & | context () noexcept |
| Get the server SSL context. More...
|
|
asio::ip::tcp::endpoint & | endpoint () noexcept |
| Get the server endpoint. More...
|
|
asio::ip::tcp::acceptor & | acceptor () noexcept |
| Get the server acceptor. More...
|
|
const std::string & | address () const noexcept |
| Get the server address. More...
|
|
int | port () const noexcept |
| Get the server port number. More...
|
|
uint64_t | connected_sessions () const noexcept |
| Get the number of sessions connected to the server. More...
|
|
uint64_t | bytes_pending () const noexcept |
| Get the number of bytes pending sent by the server. More...
|
|
uint64_t | bytes_sent () const noexcept |
| Get the number of bytes sent by the server. More...
|
|
uint64_t | bytes_received () const noexcept |
| Get the number of bytes received by the server. More...
|
|
bool | option_keep_alive () const noexcept |
| Get the option: keep alive. More...
|
|
bool | option_no_delay () const noexcept |
| Get the option: no delay. More...
|
|
bool | option_reuse_address () const noexcept |
| Get the option: reuse address. More...
|
|
bool | option_reuse_port () const noexcept |
| Get the option: reuse port. More...
|
|
bool | IsStarted () const noexcept |
| Is the server started? More...
|
|
virtual bool | Start () |
| Start the server. More...
|
|
virtual bool | Stop () |
| Stop the server. More...
|
|
virtual bool | Restart () |
| Restart the server. More...
|
|
virtual bool | Multicast (std::string_view text) |
| Multicast text to all connected sessions. More...
|
|
virtual bool | DisconnectAll () |
| Disconnect all connected sessions. More...
|
|
std::shared_ptr< SSLSession > | FindSession (const CppCommon::UUID &id) |
| Find a session with a given Id. More...
|
|
void | SetupKeepAlive (bool enable) noexcept |
| Setup option: keep alive. More...
|
|
void | SetupNoDelay (bool enable) noexcept |
| Setup option: no delay. More...
|
|
void | SetupReuseAddress (bool enable) noexcept |
| Setup option: reuse address. More...
|
|
void | SetupReusePort (bool enable) noexcept |
| Setup option: reuse port. More...
|
|
|
std::shared_ptr< Asio::SSLSession > | CreateSession (const std::shared_ptr< Asio::SSLServer > &server) override |
|
std::shared_ptr< Asio::SSLSession > | CreateSession (const std::shared_ptr< Asio::SSLServer > &server) override |
|
virtual std::shared_ptr< SSLSession > | CreateSession (const std::shared_ptr< SSLServer > &server) |
| Create SSL session factory method. More...
|
|
virtual void | onStarted () |
| Handle server started notification. More...
|
|
virtual void | onStopped () |
| Handle server stopped notification. More...
|
|
virtual void | onConnected (std::shared_ptr< SSLSession > &session) |
| Handle session connected notification. More...
|
|
virtual void | onHandshaked (std::shared_ptr< SSLSession > &session) |
| Handle session handshaked notification. More...
|
|
virtual void | onDisconnected (std::shared_ptr< SSLSession > &session) |
| Handle session disconnected notification. More...
|
|
virtual void | onError (int error, const std::string &category, const std::string &message) |
| Handle error notification. More...
|
|
virtual void | onWSConnecting (HTTP::HTTPRequest &request) |
| Handle WebSocket client connecting notification. More...
|
|
virtual void | onWSConnected (const HTTP::HTTPResponse &response) |
| Handle WebSocket client connected notification. More...
|
|
virtual bool | onWSConnecting (const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response) |
| Handle WebSocket server session validating notification. More...
|
|
virtual void | onWSConnected (const HTTP::HTTPRequest &request) |
| Handle WebSocket server session connected notification. More...
|
|
virtual void | onWSDisconnected () |
| Handle WebSocket client disconnected notification. More...
|
|
virtual void | onWSReceived (const void *buffer, size_t size) |
| Handle WebSocket received notification. More...
|
|
virtual void | onWSClose (const void *buffer, size_t size, int status=1000) |
| Handle WebSocket client close notification. More...
|
|
virtual void | onWSPing (const void *buffer, size_t size) |
| Handle WebSocket ping notification. More...
|
|
virtual void | onWSPong (const void *buffer, size_t size) |
| Handle WebSocket pong notification. More...
|
|
virtual void | onWSError (const std::string &message) |
| Handle WebSocket error notification. More...
|
|
virtual void | SendResponse (const HTTP::HTTPResponse &response) |
| Send WebSocket server upgrade response. More...
|
|
| WebSocket () |
|
| WebSocket (const WebSocket &)=delete |
|
| WebSocket (WebSocket &&)=delete |
|
| ~WebSocket ()=default |
|
WebSocket & | operator= (const WebSocket &)=delete |
|
WebSocket & | operator= (WebSocket &&)=delete |
|
std::string_view | ws_nonce () const noexcept |
| Get the WebSocket random nonce. More...
|
|
bool | PerformClientUpgrade (const HTTP::HTTPResponse &response, const CppCommon::UUID &id) |
| Perform WebSocket client upgrade. More...
|
|
bool | PerformServerUpgrade (const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response) |
| Perform WebSocket server upgrade. More...
|
|
void | PrepareSendFrame (uint8_t opcode, bool mask, const void *buffer, size_t size, int status=0) |
| Prepare WebSocket send frame. More...
|
|
void | PrepareReceiveFrame (const void *buffer, size_t size) |
| Prepare WebSocket receive frame. More...
|
|
size_t | RequiredReceiveFrameSize () |
| Required WebSocket receive frame size. More...
|
|
void | ClearWSBuffers () |
| Clear WebSocket send/receive buffers. More...
|
|
void | InitWSNonce () |
| Initialize WebSocket random nonce. More...
|
|
WebSocket secure server.
WebSocket secure server is used to communicate with clients using WebSocket secure protocol.
https://en.wikipedia.org/wiki/WebSocket
Thread-safe.
- Examples
- wss_chat_server.cpp.
Definition at line 28 of file wss_server.h.