|
| | 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| void | RemoveStaticContent (const CppCommon::Path &path) |
| | Remove static content cache.
|
| |
| void | ClearStaticContent () |
| | Clear static content cache.
|
| |
| void | Watchdog (const CppCommon::UtcTimestamp &utc=CppCommon::UtcTimestamp()) |
| | Watchdog the static content cache.
|
| |
| | 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.
|
| |
| | 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.
|
| |
| | 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.
|
| |
| | 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.
|
| |
| std::shared_ptr< Service > & | service () noexcept |
| | Get the Asio service.
|
| |
| std::shared_ptr< asio::io_service > & | io_service () noexcept |
| | Get the Asio IO service.
|
| |
| asio::io_service::strand & | strand () noexcept |
| | Get the Asio service strand for serialized handler execution.
|
| |
| std::shared_ptr< SSLContext > & | context () noexcept |
| | Get the server SSL context.
|
| |
| asio::ip::tcp::endpoint & | endpoint () noexcept |
| | Get the server endpoint.
|
| |
| asio::ip::tcp::acceptor & | acceptor () noexcept |
| | Get the server acceptor.
|
| |
| const std::string & | address () const noexcept |
| | Get the server address.
|
| |
| int | port () const noexcept |
| | Get the server port number.
|
| |
| uint64_t | connected_sessions () const noexcept |
| | Get the number of sessions connected to the server.
|
| |
| uint64_t | bytes_pending () const noexcept |
| | Get the number of bytes pending sent by the server.
|
| |
| uint64_t | bytes_sent () const noexcept |
| | Get the number of bytes sent by the server.
|
| |
| uint64_t | bytes_received () const noexcept |
| | Get the number of bytes received by the server.
|
| |
| bool | option_keep_alive () const noexcept |
| | Get the option: keep alive.
|
| |
| bool | option_no_delay () const noexcept |
| | Get the option: no delay.
|
| |
| bool | option_reuse_address () const noexcept |
| | Get the option: reuse address.
|
| |
| bool | option_reuse_port () const noexcept |
| | Get the option: reuse port.
|
| |
| bool | IsStarted () const noexcept |
| | Is the server started?
|
| |
| virtual bool | Start () |
| | Start the server.
|
| |
| virtual bool | Stop () |
| | Stop the server.
|
| |
| virtual bool | Restart () |
| | Restart the server.
|
| |
| virtual bool | Multicast (std::string_view text) |
| | Multicast text to all connected sessions.
|
| |
| virtual bool | DisconnectAll () |
| | Disconnect all connected sessions.
|
| |
| std::shared_ptr< SSLSession > | FindSession (const CppCommon::UUID &id) |
| | Find a session with a given Id.
|
| |
| void | SetupKeepAlive (bool enable) noexcept |
| | Setup option: keep alive.
|
| |
| void | SetupNoDelay (bool enable) noexcept |
| | Setup option: no delay.
|
| |
| void | SetupReuseAddress (bool enable) noexcept |
| | Setup option: reuse address.
|
| |
| void | SetupReusePort (bool enable) noexcept |
| | Setup option: reuse port.
|
| |
|
| 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.
|
| |
| virtual void | onStarted () |
| | Handle server started notification.
|
| |
| virtual void | onStopped () |
| | Handle server stopped notification.
|
| |
| virtual void | onConnected (std::shared_ptr< SSLSession > &session) |
| | Handle session connected notification.
|
| |
| virtual void | onHandshaked (std::shared_ptr< SSLSession > &session) |
| | Handle session handshaked notification.
|
| |
| virtual void | onDisconnected (std::shared_ptr< SSLSession > &session) |
| | Handle session disconnected notification.
|
| |
| virtual void | onError (int error, const std::string &category, const std::string &message) |
| | Handle error notification.
|
| |
| virtual void | onWSConnecting (HTTP::HTTPRequest &request) |
| | Handle WebSocket client connecting notification.
|
| |
| virtual void | onWSConnected (const HTTP::HTTPResponse &response) |
| | Handle WebSocket client connected notification.
|
| |
| virtual bool | onWSConnecting (const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response) |
| | Handle WebSocket server session validating notification.
|
| |
| virtual void | onWSConnected (const HTTP::HTTPRequest &request) |
| | Handle WebSocket server session connected notification.
|
| |
| virtual void | onWSDisconnected () |
| | Handle WebSocket client disconnected notification.
|
| |
| virtual void | onWSReceived (const void *buffer, size_t size) |
| | Handle WebSocket received notification.
|
| |
| virtual void | onWSClose (const void *buffer, size_t size, int status=1000) |
| | Handle WebSocket client close notification.
|
| |
| virtual void | onWSPing (const void *buffer, size_t size) |
| | Handle WebSocket ping notification.
|
| |
| virtual void | onWSPong (const void *buffer, size_t size) |
| | Handle WebSocket pong notification.
|
| |
| virtual void | onWSError (const std::string &message) |
| | Handle WebSocket error notification.
|
| |
| virtual void | SendResponse (const HTTP::HTTPResponse &response) |
| | Send WebSocket server upgrade response.
|
| |
| | 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.
|
| |
| bool | PerformClientUpgrade (const HTTP::HTTPResponse &response, const CppCommon::UUID &id) |
| | Perform WebSocket client upgrade.
|
| |
| bool | PerformServerUpgrade (const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response) |
| | Perform WebSocket server upgrade.
|
| |
| void | PrepareSendFrame (uint8_t opcode, bool mask, const void *buffer, size_t size, int status=0) |
| | Prepare WebSocket send frame.
|
| |
| void | PrepareReceiveFrame (const void *buffer, size_t size) |
| | Prepare WebSocket receive frame.
|
| |
| size_t | RequiredReceiveFrameSize () |
| | Required WebSocket receive frame size.
|
| |
| void | ClearWSBuffers () |
| | Clear WebSocket send/receive buffers.
|
| |
| void | InitWSNonce () |
| | Initialize WebSocket random nonce.
|
| |
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.