ofxHTTP
A collection of tools for HTTP.
|
The base implmentation of a server route. More...
#include <BaseRoute.h>
Public Member Functions | |
BaseRoute_ (const SettingsType &settings=SettingsType()) | |
Create a BaseRoute. More... | |
virtual | ~BaseRoute_ () |
Destroy a BaseRoute. | |
virtual void | setup (const SettingsType &settings) |
Setup the route with settings. More... | |
virtual std::string | routePathPattern () const override |
Get the route's regex path pattern. More... | |
virtual bool | canHandleRequest (const Poco::Net::HTTPServerRequest &request, bool isSecurePort) const override |
Determine if this route can handle the given request. More... | |
virtual Poco::Net::HTTPRequestHandler * | createRequestHandler (const Poco::Net::HTTPServerRequest &request) override |
Creates a new HTTPRequestHandler for the given request. More... | |
void | handleRequest (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) override |
virtual void | handleRequest (ServerEventArgs &evt) override |
Handle the ServerEventArgs. More... | |
virtual void | stop () override |
Stop any pending activity and close this route. More... | |
const SettingsType & | settings () const |
AbstractServer * | getServer () override |
void | setServer (AbstractServer *server) override |
Set the server that owns this route. More... | |
Public Member Functions inherited from ofx::HTTP::AbstractRoute | |
virtual | ~AbstractRoute () |
Destroy the AbstractRoute instance. | |
Public Member Functions inherited from ofx::HTTP::AbstractHTTPRequestHandler | |
virtual | ~AbstractHTTPRequestHandler () |
Destroy the AbstractHTTPRequestHandler. | |
Public Member Functions inherited from ofx::HTTP::AbstractServerEventRequestHandler | |
virtual | ~AbstractServerEventRequestHandler () |
Destroy the AbstractServerEventRequestHandler. | |
Public Member Functions inherited from ofx::HTTP::AbstractHTTPRequestHandlerFactory | |
virtual | ~AbstractHTTPRequestHandlerFactory () |
Destroy the AbstractHTTPRequestHandlerFactory. | |
Protected Attributes | |
SettingsType | _settings |
The settings. | |
AbstractServer * | _server = nullptr |
A pointer to the server. | |
The base implmentation of a server route.
SettingsType | The settings used for this templated route. |
ofx::HTTP::BaseRoute_< SettingsType >::BaseRoute_ | ( | const SettingsType & | settings = SettingsType() | ) |
Create a BaseRoute.
settings | The settings to use for route configuration. |
|
overridevirtual |
Determine if this route can handle the given request.
request | The incoming Poco::Net::HTTPServerRequest to be tested. |
isSecurePort | true iff the connection is SSL encrypted. Some implmenetations of this interface may choose to only handle requests on secure ports. |
Implements ofx::HTTP::AbstractRoute.
Reimplemented in ofx::HTTP::WebSocketRoute, and ofx::HTTP::SSERoute.
|
overridevirtual |
Creates a new HTTPRequestHandler for the given request.
Before this is called, it is expected that the calling server has confirmed that this route is capable of handling the request by calling canHandleRequest().
request | The HTTPServerRequest to be passed to the handler. |
Implements ofx::HTTP::AbstractHTTPRequestHandlerFactory.
Reimplemented in ofx::HTTP::IPVideoRoute, ofx::HTTP::WebSocketRoute, ofx::HTTP::PostRoute, ofx::HTTP::SSERoute, and ofx::HTTP::FileSystemRoute.
|
overridevirtual |
Implements ofx::HTTP::AbstractRoute.
|
overridevirtual |
Handle the ServerEventArgs.
evt | The server request event. |
Implements ofx::HTTP::AbstractServerEventRequestHandler.
Reimplemented in ofx::HTTP::FileSystemRoute.
|
overridevirtual |
Get the route's regex path pattern.
The path pattern is used to match incoming server requests and allows requests to be routed to different routes based on their requested URI.
Implements ofx::HTTP::AbstractRoute.
|
overridevirtual |
Set the server that owns this route.
server | A pointer to the server that owns this route. |
Implements ofx::HTTP::AbstractRoute.
const SettingsType & ofx::HTTP::BaseRoute_< SettingsType >::settings | ( | ) | const |
|
virtual |
Setup the route with settings.
settings | The seetings to use for setup. |
|
overridevirtual |
Stop any pending activity and close this route.
This method may block until the route is fully stopped.
Implements ofx::HTTP::AbstractRoute.
Reimplemented in ofx::HTTP::IPVideoRoute, ofx::HTTP::WebSocketRoute, and ofx::HTTP::SSERoute.