WebSocket++ 0.8.3-dev
C++ websocket client/server library
Loading...
Searching...
No Matches
websocketpp::processor::hybi08< config > Class Template Reference

Processor for Hybi Draft version 08. More...

#include <hybi08.hpp>

Inheritance diagram for websocketpp::processor::hybi08< config >:
websocketpp::processor::hybi13< config > websocketpp::processor::processor< config > websocketpp::processor::hybi07< config >

Public Types

typedef hybi08< config > type
typedef config::request_type request_type
typedef config::con_msg_manager_type::ptr msg_manager_ptr
typedef config::rng_type rng_type
Public Types inherited from websocketpp::processor::hybi13< config >
typedef processor< config > base
typedef config::request_type request_type
typedef config::response_type response_type
typedef config::message_type message_type
typedef message_type::ptr message_ptr
typedef config::con_msg_manager_type msg_manager_type
typedef msg_manager_type::ptr msg_manager_ptr
typedef config::rng_type rng_type
typedef config::permessage_deflate_type permessage_deflate_type
typedef std::pair< lib::error_code, std::string > err_str_pair
Public Types inherited from websocketpp::processor::processor< config >
typedef processor< config > type
typedef config::request_type request_type
typedef config::response_type response_type
typedef config::message_type::ptr message_ptr
typedef std::pair< lib::error_code, std::string > err_str_pair

Public Member Functions

 hybi08 (bool secure, bool p_is_server, msg_manager_ptr manager, rng_type &rng)
lib::error_code client_handshake_request (request_type &, uri_ptr, std::vector< std::string > const &) const
 Fill in a set of request headers for a client connection request.
int get_version () const
 Get the protocol version of this processor.
std::string const & get_origin (request_type const &r) const
 Return the value of the header containing the CORS origin.
Public Member Functions inherited from websocketpp::processor::hybi13< config >
 hybi13 (bool secure, bool p_is_server, msg_manager_ptr manager, rng_type &rng)
int get_version () const
 Get the protocol version of this processor.
bool has_permessage_deflate () const
err_str_pair negotiate_extensions (request_type const &request)
 Initializes extensions based on the Sec-WebSocket-Extensions header.
err_str_pair negotiate_extensions (response_type const &response)
 Initializes extensions based on the Sec-WebSocket-Extensions header.
template<typename header_type>
err_str_pair negotiate_extensions_helper (header_type const &header)
 Extension negotiation helper function.
lib::error_code validate_handshake (request_type const &r) const
 validate a WebSocket handshake request for this version
lib::error_code process_handshake (request_type const &request, std::string const &subprotocol, response_type &response) const
 Calculate the appropriate response for this websocket request.
lib::error_code client_handshake_request (request_type &req, uri_ptr uri, std::vector< std::string > const &subprotocols) const
 Fill in a set of request headers for a client connection request.
lib::error_code validate_server_handshake_response (request_type const &req, response_type &res) const
 Validate the server's response to an outgoing handshake request.
std::string get_raw (response_type const &res) const
 Given a completed response, get the raw bytes to put on the wire.
std::string const & get_origin (request_type const &r) const
 Return the value of the header containing the CORS origin.
lib::error_code extract_subprotocols (request_type const &req, std::vector< std::string > &subprotocol_list)
 Extracts requested subprotocols from a handshake request.
uri_ptr get_uri (request_type const &request) const
 Extracts client uri from a handshake request.
size_t consume (uint8_t *buf, size_t len, lib::error_code &ec)
 Process new websocket connection bytes.
lib::error_code finalize_message ()
 Perform any finalization actions on an incoming message.
void reset_headers ()
bool ready () const
 Test whether or not the processor has a message ready.
message_ptr get_message ()
 Retrieves the most recently processed message.
bool get_error () const
 Test whether or not the processor is in a fatal error state.
size_t get_bytes_needed () const
virtual lib::error_code prepare_data_frame (message_ptr in, message_ptr out)
 Prepare a user data message for writing.
lib::error_code prepare_ping (std::string const &in, message_ptr out) const
 Get URI.
lib::error_code prepare_pong (std::string const &in, message_ptr out) const
virtual lib::error_code prepare_close (close::status::value code, std::string const &reason, message_ptr out) const
Public Member Functions inherited from websocketpp::processor::processor< config >
 processor (bool secure, bool p_is_server)
size_t get_max_message_size () const
 Get maximum message size.
void set_max_message_size (size_t new_value)
 Set maximum message size.
virtual bool has_permessage_compress () const
 Returns whether or not the permessage_compress extension is implemented.
virtual lib::error_code prepare_data_frame (message_ptr in, message_ptr out)=0
 Prepare a data message for writing.
virtual lib::error_code prepare_ping (std::string const &in, message_ptr out) const =0
 Prepare a ping frame.
virtual lib::error_code prepare_pong (std::string const &in, message_ptr out) const =0
 Prepare a pong frame.
virtual lib::error_code prepare_close (close::status::value code, std::string const &reason, message_ptr out) const =0
 Prepare a close frame.

Additional Inherited Members

Protected Types inherited from websocketpp::processor::hybi13< config >
enum  state {
  HEADER_BASIC = 0 , HEADER_EXTENDED = 1 , EXTENSION = 2 , APPLICATION = 3 ,
  READY = 4 , FATAL_ERROR = 5
}
Protected Member Functions inherited from websocketpp::processor::hybi13< config >
lib::error_code process_handshake_key (std::string &key) const
 Convert a client handshake key into a server response key in place.
size_t copy_basic_header_bytes (uint8_t const *buf, size_t len)
 Reads bytes from buf into m_basic_header.
size_t copy_extended_header_bytes (uint8_t const *buf, size_t len)
 Reads bytes from buf into m_extended_header.
size_t process_payload_bytes (uint8_t *buf, size_t len, lib::error_code &ec)
 Reads bytes from buf into message payload.
lib::error_code validate_incoming_basic_header (frame::basic_header const &h, bool is_server, bool new_msg) const
 Validate an incoming basic header.
lib::error_code validate_incoming_extended_header (frame::basic_header h, frame::extended_header e) const
 Validate an incoming extended header.
void masked_copy (std::string const &i, std::string &o, frame::masking_key_type key) const
 Copy and mask/unmask in one operation.
lib::error_code prepare_control (frame::opcode::value op, std::string const &payload, message_ptr out) const
 Generic prepare control frame with opcode and payload.
Protected Attributes inherited from websocketpp::processor::hybi13< config >
frame::basic_header m_basic_header
msg_manager_ptr m_msg_manager
size_t m_bytes_needed
size_t m_cursor
msg_metadata m_data_msg
msg_metadata m_control_msg
msg_metadatam_current_msg
frame::extended_header m_extended_header
rng_type & m_rng
state m_state
permessage_deflate_type m_permessage_deflate
Protected Attributes inherited from websocketpp::processor::processor< config >
bool const m_secure
bool const m_server
size_t m_max_message_size

Detailed Description

template<typename config>
class websocketpp::processor::hybi08< config >

Processor for Hybi Draft version 08.

The primary difference between 08 and 13 is a different origin header name

Definition at line 44 of file hybi08.hpp.

Member Typedef Documentation

◆ msg_manager_ptr

template<typename config>
typedef config::con_msg_manager_type::ptr websocketpp::processor::hybi08< config >::msg_manager_ptr

Definition at line 49 of file hybi08.hpp.

◆ request_type

template<typename config>
typedef config::request_type websocketpp::processor::hybi08< config >::request_type

Definition at line 47 of file hybi08.hpp.

◆ rng_type

template<typename config>
typedef config::rng_type websocketpp::processor::hybi08< config >::rng_type

Definition at line 50 of file hybi08.hpp.

◆ type

template<typename config>
typedef hybi08<config> websocketpp::processor::hybi08< config >::type

Definition at line 46 of file hybi08.hpp.

Constructor & Destructor Documentation

◆ hybi08()

template<typename config>
websocketpp::processor::hybi08< config >::hybi08 ( bool secure,
bool p_is_server,
msg_manager_ptr manager,
rng_type & rng )
inlineexplicit

Definition at line 52 of file hybi08.hpp.

Member Function Documentation

◆ client_handshake_request()

template<typename config>
lib::error_code websocketpp::processor::hybi08< config >::client_handshake_request ( request_type & ,
uri_ptr ,
std::vector< std::string > const &  ) const
inlinevirtual

Fill in a set of request headers for a client connection request.

The Hybi 08 processor only implements incoming connections so this will always return an error.

Parameters
[out]reqSet of headers to fill in
[in]uriThe uri being connected to
[in]subprotocolsThe list of subprotocols to request

Implements websocketpp::processor::processor< config >.

Definition at line 64 of file hybi08.hpp.

◆ get_origin()

template<typename config>
std::string const & websocketpp::processor::hybi08< config >::get_origin ( request_type const & request) const
inlinevirtual

Return the value of the header containing the CORS origin.

Implements websocketpp::processor::processor< config >.

Definition at line 74 of file hybi08.hpp.

◆ get_version()

template<typename config>
int websocketpp::processor::hybi08< config >::get_version ( ) const
inlinevirtual

Get the protocol version of this processor.

Implements websocketpp::processor::processor< config >.

Definition at line 70 of file hybi08.hpp.


The documentation for this class was generated from the following file: