fwoop http¶
-
class HttpFrame¶
Subclassed by fwoop::HttpDataFrame, fwoop::HttpGoAwayFrame, fwoop::HttpHeadersFrame, fwoop::HttpSettingsFrame, fwoop::HttpWindowUpdateFrame
Public Types
Public Functions
-
inline virtual ~HttpFrame()¶
-
inline void setStreamID(uint32_t id)¶
-
inline void setLength(unsigned int length)¶
-
inline unsigned int length() const¶
-
inline uint8_t *payload() const¶
-
void printHex() const¶
-
void printHeader() const¶
-
inline unsigned int encodingLength() const¶
-
inline virtual uint8_t *encode() const¶
-
inline uint32_t getStreamID() const¶
Public Static Functions
Public Static Attributes
-
static constexpr unsigned int HEADER_LENGTH = 9¶
-
inline virtual ~HttpFrame()¶
-
enum fwoop::HttpHeader¶
Values:
-
enumerator Undefined¶
-
enumerator Authority¶
-
enumerator Method¶
-
enumerator Path¶
-
enumerator Scheme¶
-
enumerator Status¶
-
enumerator AcceptCharset¶
-
enumerator AcceptEncoding¶
-
enumerator AcceptLanguage¶
-
enumerator AcceptRanges¶
-
enumerator Accept¶
-
enumerator AccessControlAllowOrigin¶
-
enumerator Age¶
-
enumerator Allow¶
-
enumerator Authorization¶
-
enumerator CacheControl¶
-
enumerator ContentDisposition¶
-
enumerator ContentEncoding¶
-
enumerator ContentLanguage¶
-
enumerator ContentLength¶
-
enumerator ContentLocation¶
-
enumerator ContentRange¶
-
enumerator ContentType¶
-
enumerator Cookie¶
-
enumerator Date¶
-
enumerator Etag¶
-
enumerator Expect¶
-
enumerator Expires¶
-
enumerator From¶
-
enumerator Host¶
-
enumerator IfMatch¶
-
enumerator IfModifiedSince¶
-
enumerator IfNoneMatch¶
-
enumerator IfRange¶
-
enumerator IfUnmodifiedSince¶
-
enumerator LastModified¶
-
enumerator Link¶
-
enumerator Location¶
-
enumerator MaxForwards¶
-
enumerator ProxyAuthenticate¶
-
enumerator ProxyAuthorization¶
-
enumerator Range¶
-
enumerator Referer¶
-
enumerator Refresh¶
-
enumerator RetryAfter¶
-
enumerator Server¶
-
enumerator SetCookie¶
-
enumerator StrictTransportSecurity¶
-
enumerator TransferEncoding¶
-
enumerator UserAgent¶
-
enumerator Vary¶
-
enumerator Via¶
-
enumerator WwwAuthenticate¶
-
enumerator Undefined¶
-
class HttpHeadersFrame : public fwoop::HttpFrame¶
Public Types
Public Functions
-
HttpHeadersFrame(unsigned int length, uint8_t flags, uint8_t *streamID, uint8_t *payload)¶
-
void addHeaderBlock(HttpHeader &&name, std::string &&value)¶
-
void addHeaderBlock(const std::string &name, const std::string &value)¶
-
inline void clearHeaderBlocks()¶
-
virtual uint8_t *encode() const override¶
-
inline std::vector<HttpHeaderField_t>::const_iterator beginHeaderList() const¶
-
inline std::vector<HttpHeaderField_t>::const_iterator endHeaderList() const¶
-
HttpHeadersFrame(unsigned int length, uint8_t flags, uint8_t *streamID, uint8_t *payload)¶
-
class HttpHPacker¶
-
class HttpRequest¶
Public Types
Public Functions
-
explicit HttpRequest()¶
-
inline void addHeader(const HttpHeader &name, const std::string &value)¶
-
inline void addHeader(const HttpCustomHeader &name, const std::string &value)¶
-
inline void setPath(const std::string &path)¶
-
inline void setBody(const std::string &body)¶
-
inline void setVersion(const HttpVersion::Value &version)¶
-
inline const std::string &getPath() const¶
-
inline HttpVersion::Value getVersion() const¶
-
inline const std::vector<HttpHeaderField_t> &getHeaders() const¶
-
inline bool canUpgrade() const¶
-
uint8_t *encode(uint32_t &length) const¶
Public Static Functions
-
static std::shared_ptr<HttpRequest> parse(uint8_t *buffer, uint32_t bufferSize, uint32_t &bytesParsed)¶
-
explicit HttpRequest()¶
-
class HttpResponse¶
-
Public Functions
-
explicit HttpResponse()¶
-
BuildResult build(uint8_t *buffer, uint32_t bufferSize, uint32_t &bytesParsed)¶
-
inline void setStatus(const std::string &status)¶
-
inline void addHeader(const HttpHeader &name, const std::string &value)¶
-
inline void addHeader(const HttpCustomHeader &name, const std::string &value)¶
-
inline void setBody(const std::string &body)¶
-
void streamFile(const std::string &fileName)¶
-
uint8_t *encode(uint32_t &length) const¶
-
inline const HttpVersion::Value getVersion() const¶
-
inline const std::vector<HttpHeaderField_t> getHeaders() const¶
-
inline const std::string &getStatus() const¶
-
inline const std::string &getBody() const¶
-
inline const std::string &getFile() const¶
-
explicit HttpResponse()¶
-
class HttpServer : public fwoop::HttpRequestCallback¶
Public Functions
-
explicit HttpServer(int port, HttpVersion::Value version, unsigned int threadPoolSize = 5)¶
-
~HttpServer()¶
-
int serve()¶
-
inline void stop()¶
-
void addRoute(const std::string &route, HttpHandlerFunc_t func)¶
-
void addStaticRoute(const std::string &route, const std::string &fileName)¶
-
void addServerEventRoute(const std::string &route, HttpServerEventHandlerFunc_t func)¶
-
explicit HttpServer(int port, HttpVersion::Value version, unsigned int threadPoolSize = 5)¶
-
class HttpSettingsFrame : public fwoop::HttpFrame¶
Public Functions
-
HttpSettingsFrame(unsigned int length, uint8_t flags, uint8_t *streamID, uint8_t *payload)¶
-
explicit HttpSettingsFrame()¶
-
inline ~HttpSettingsFrame()¶
-
inline void setAck()¶
-
inline void setHeaderTableSize(uint32_t headerTableSize)¶
-
void setEnablePush(bool enablePush)¶
-
void setMaxConcurrentStreams(uint32_t maxConcurrentStreams)¶
-
void setInitialWindowSize(uint32_t initialWindowSize)¶
-
inline void setMaxFrameSize(uint32_t maxFrameSize)¶
-
void setMaxHeaderListSize(uint32_t maxHeaderListSize)¶
-
inline std::optional<uint32_t> headerTableSize() const¶
-
inline bool enablePush() const¶
-
inline std::optional<uint32_t> maxConcurrentStreams() const¶
-
inline std::optional<uint32_t> initialWindowSize() const¶
-
inline std::optional<uint32_t> maxFrameSize() const¶
-
inline std::optional<uint32_t> maxHeaderListSize() const¶
-
virtual uint8_t *encode() const override¶
-
HttpSettingsFrame(unsigned int length, uint8_t flags, uint8_t *streamID, uint8_t *payload)¶
-
class HttpStream¶