ofxHTTP
A collection of tools for HTTP.
|
Settings for a WebSocketRoute. More...
#include <WebSocketRoute.h>
Public Types | |
enum | { DEFAULT_BUFFER_SIZE = 8192 } |
typedef std::set< std::string > | SubprotocolSet |
A typedef for subprotocols. | |
typedef std::set< std::string > | OriginSet |
A typedef for origins. | |
Public Types inherited from ofx::HTTP::BaseRouteSettings | |
typedef std::set< std::string > | HTTPMethodSet |
A typedef for HTTPMethodSet. | |
typedef std::set< std::string > | MediaTypeSet |
A typedef for a MediaTypeSet. | |
Public Member Functions | |
WebSocketRouteSettings (const std::string &routePathPattern=DEFAULT_WEBSOCKET_ROUTE_PATH_PATTERN, bool requireSecurePort=false) | |
Create a WebSocketRouteSettings. More... | |
virtual | ~WebSocketRouteSettings () |
Destroy the WebSocketRouteSettings. | |
void | setValidSubprotcols (const SubprotocolSet &subprotocols) |
Set the list of valid subprotocols. More... | |
const SubprotocolSet & | getValidSubprotocols () const |
Get a set of valid subprotocols. More... | |
void | setValidOrigins (const OriginSet &origins) |
Set the list of valid origins. More... | |
const OriginSet & | getValidOrigins () const |
Get a set of valid origins. More... | |
void | setAutoPingPongResponse (bool autoPingPongResponse) |
bool | getAutoPingPongResponse () const |
void | setKeepAlive (bool keepAlive) |
bool | getKeepAlive () const |
void | setReceiveTimeout (const Poco::Timespan &receiveTimeout) |
Set the receive timeout. More... | |
Poco::Timespan | getReceiveTimeout () const |
void | setSendTimeout (const Poco::Timespan &sendTimeout) |
Set the send timeout. More... | |
Poco::Timespan | getSendTimeout () const |
void | setPollTimeout (const Poco::Timespan &pollTimeout) |
Set the polling timeout. More... | |
Poco::Timespan | getPollTimeout () const |
void | setBufferSize (std::size_t bufferSize) |
Set the WebSocket buffers size. More... | |
std::size_t | getBufferSize () const |
Get the WebSocket buffer size. More... | |
Public Member Functions inherited from ofx::HTTP::BaseRouteSettings | |
BaseRouteSettings (const std::string &routePathPattern=BaseRouteSettings::DEFAULT_ROUTE_PATH_PATTERN, bool requireSecurePort=false, bool requireAuthentication=false, const HTTPMethodSet &validHTTPMethods=HTTPMethodSet()) | |
Create the BaseRouteSettings with the given route path. More... | |
virtual | ~BaseRouteSettings () |
Destroy the BaseRoutSettings. | |
void | setRoutePathPattern (const std::string &routePathPattern) |
Set the route path regex pattern. More... | |
const std::string & | getRoutePathPattern () const |
void | setRequireSecurePort (bool requireSecurePort) |
Set the secure port requirement. More... | |
bool | requireSecurePort () const |
void | setRequireAuthentication (bool requireAuthentication) |
Set the authentication requirement. More... | |
bool | requireAuthentication () const |
void | setValidHTTPMethods (const HTTPMethodSet &validHTTPMethods) |
Set the list of valid HTTPMethods. More... | |
const HTTPMethodSet & | getValidHTTPMethods () const |
void | setValidContentTypes (const MediaTypeSet &validContentTypes) |
Set the list of valid Content Types. More... | |
const MediaTypeSet & | getValidContentTypes () const |
Static Public Attributes | |
static const std::string | DEFAULT_WEBSOCKET_ROUTE_PATH_PATTERN = "/" |
The default WebSocketRoute path pattern. | |
static const Poco::Timespan | DEFAULT_RECEIVE_TIMEOUT = Poco::Timespan(60 * Poco::Timespan::SECONDS) |
static const Poco::Timespan | DEFAULT_SEND_TIMEOUT = Poco::Timespan(60 * Poco::Timespan::SECONDS) |
static const Poco::Timespan | DEFAULT_POLL_TIMEOUT = Poco::Timespan(10 * Poco::Timespan::MILLISECONDS) |
Static Public Attributes inherited from ofx::HTTP::BaseRouteSettings | |
static const std::string | DEFAULT_ROUTE_PATH_PATTERN = "/.*" |
The default route path regex pattern. More... | |
Settings for a WebSocketRoute.
ofx::HTTP::WebSocketRouteSettings::WebSocketRouteSettings | ( | const std::string & | routePathPattern = DEFAULT_WEBSOCKET_ROUTE_PATH_PATTERN , |
bool | requireSecurePort = false |
||
) |
Create a WebSocketRouteSettings.
routePathPattern | The regex pattern that this route will handle. |
requireSecurePort | True if this route requires communication on an SSL encrypted port. |
bool ofx::HTTP::WebSocketRouteSettings::getAutoPingPongResponse | ( | ) | const |
std::size_t ofx::HTTP::WebSocketRouteSettings::getBufferSize | ( | ) | const |
Get the WebSocket buffer size.
bool ofx::HTTP::WebSocketRouteSettings::getKeepAlive | ( | ) | const |
Poco::Timespan ofx::HTTP::WebSocketRouteSettings::getPollTimeout | ( | ) | const |
Poco::Timespan ofx::HTTP::WebSocketRouteSettings::getReceiveTimeout | ( | ) | const |
Poco::Timespan ofx::HTTP::WebSocketRouteSettings::getSendTimeout | ( | ) | const |
const WebSocketRouteSettings::OriginSet & ofx::HTTP::WebSocketRouteSettings::getValidOrigins | ( | ) | const |
Get a set of valid origins.
If empty, all Origin headers will be accepted.
const WebSocketRouteSettings::SubprotocolSet & ofx::HTTP::WebSocketRouteSettings::getValidSubprotocols | ( | ) | const |
Get a set of valid subprotocols.
If empty, all requested subprotocols will be accepted.
void ofx::HTTP::WebSocketRouteSettings::setAutoPingPongResponse | ( | bool | autoPingPongResponse | ) |
autoPingPongResponse | If set to true, the WebSocket connection will return all PINGs with a PONG. |
void ofx::HTTP::WebSocketRouteSettings::setBufferSize | ( | std::size_t | bufferSize | ) |
Set the WebSocket buffers size.
bufferSize | The buffer size in bytes. |
void ofx::HTTP::WebSocketRouteSettings::setKeepAlive | ( | bool | keepAlive | ) |
keepAlive | True iff keep alive should be enabled. |
void ofx::HTTP::WebSocketRouteSettings::setPollTimeout | ( | const Poco::Timespan & | pollTimeout | ) |
Set the polling timeout.
pollTimeout | the polling timeout. |
void ofx::HTTP::WebSocketRouteSettings::setReceiveTimeout | ( | const Poco::Timespan & | receiveTimeout | ) |
Set the receive timeout.
receiveTimeout | The amount of time to wait when receiving data. |
void ofx::HTTP::WebSocketRouteSettings::setSendTimeout | ( | const Poco::Timespan & | sendTimeout | ) |
Set the send timeout.
sendTimeout | the send timeout to set. |
void ofx::HTTP::WebSocketRouteSettings::setValidOrigins | ( | const OriginSet & | origins | ) |
Set the list of valid origins.
An empty set means that any Origin header in the request will be accepted. A non-empty set means that the request origin MUST be in the set.
origins | A set of valid origins. |
void ofx::HTTP::WebSocketRouteSettings::setValidSubprotcols | ( | const SubprotocolSet & | subprotocols | ) |
Set the list of valid subprotocols.
An empty set means that any requested subprotocol will be accepted. A non-empty set means that the requested subprotocol MUST be in the set.
subprotocols | A set of valid subprotocols. |