2#ifndef __ASE_WEBSOCKET_HH__
3#define __ASE_WEBSOCKET_HH__
19 bool is_open ()
const;
21 void log_status (
int status,
const String &filepath =
"");
38 const int logflags_ = 0;
49 virtual void http_dir (
const String &path) = 0;
50 virtual void http_alias (
const String &webdir,
const String &path) = 0;
52 virtual int listen_port ()
const = 0;
54 virtual void listen (
const String &host =
"",
int port = 0,
const UnlistenCB& = {}) = 0;
55 virtual void reset () = 0;
56 virtual void shutdown () = 0;
57 virtual void see_other (
const String &uri) = 0;
59 static String user_agent ();
virtual void closed()
Pairs with opened().
virtual int validate()
Return true to allow opened().
virtual void http_request()
Independent of socket ops.
virtual void opened()
Pairs with closed().
bool send_binary(const String &blob)
Returns true if binary blob was sent.
virtual void message(const String &message)
Only if opened.
virtual void failed()
Never folloed by opened().
bool send_text(const String &message)
Returns true if text message was sent.
virtual bool authenticated(const std::string &token)
Return true to allow validate().
static bool utf8_validate(const std::string &utf8string)
Validate UTF-8 string with websocketpp::utf8_validator.
The Anklang C++ API namespace.
std::string String
Convenience alias for std::string.