27 #define LWS_RECOMMENDED_MIN_HEADER_SPACE 2048
76 const char *other_headers,
int other_headers_len);
141 typedef const char *(*lws_process_html_state_cb)(
void *data,
int index);
218 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_HTTP_HEADERS_ALL)
219 WSI_TOKEN_OPTIONS_URI,
225 #if defined(LWS_ROLE_WS) || defined(LWS_HTTP_HEADERS_ALL)
229 #if defined(LWS_ROLE_WS) || defined(LWS_HTTP_HEADERS_ALL)
230 WSI_TOKEN_EXTENSIONS,
238 #if defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
239 WSI_TOKEN_HTTP2_SETTINGS,
242 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_HTTP_HEADERS_ALL)
243 WSI_TOKEN_HTTP_AC_REQUEST_HEADERS,
257 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
258 WSI_TOKEN_HTTP_REFERER,
260 #if defined(LWS_ROLE_WS) || defined(LWS_HTTP_HEADERS_ALL)
265 #if defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
266 WSI_TOKEN_HTTP_COLON_AUTHORITY,
267 WSI_TOKEN_HTTP_COLON_METHOD,
268 WSI_TOKEN_HTTP_COLON_PATH,
269 WSI_TOKEN_HTTP_COLON_SCHEME,
270 WSI_TOKEN_HTTP_COLON_STATUS,
273 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
274 WSI_TOKEN_HTTP_ACCEPT_CHARSET,
277 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
278 WSI_TOKEN_HTTP_ACCESS_CONTROL_ALLOW_ORIGIN,
297 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
298 WSI_TOKEN_HTTP_MAX_FORWARDS,
299 WSI_TOKEN_HTTP_PROXY_AUTHENTICATE,
300 WSI_TOKEN_HTTP_PROXY_AUTHORIZATION,
306 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
307 WSI_TOKEN_HTTP_STRICT_TRANSPORT_SECURITY,
310 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
311 WSI_TOKEN_HTTP_USER_AGENT,
314 WSI_TOKEN_HTTP_WWW_AUTHENTICATE,
316 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_HTTP_HEADERS_ALL)
319 WSI_TOKEN_DELETE_URI,
323 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_HTTP_HEADERS_ALL)
325 WSI_TOKEN_HTTP_X_REAL_IP,
331 #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) || defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
333 WSI_TOKEN_REPLAY_NONCE,
335 #if defined(LWS_ROLE_H2) || defined(LWS_HTTP_HEADERS_ALL)
336 WSI_TOKEN_COLON_PROTOCOL,
361 #if defined(LWS_WITH_CUSTOM_HEADERS) || defined(LWS_HTTP_HEADERS_ALL)
362 WSI_TOKEN_UNKNOWN_VALUE_PART,
580 #define LWSAHH_CODE_MASK ((1 << 16) - 1)
581 #define LWSAHH_FLAG_NO_SERVER_NAME (1 << 30)
599 unsigned int code,
unsigned char **p,
615 const unsigned char *value,
int length,
616 unsigned char **p,
unsigned char *end);
632 const unsigned char *value,
int length,
633 unsigned char **p,
unsigned char *end);
647 unsigned char **p,
unsigned char *end);
674 unsigned char **p,
unsigned char *end);
676 #define LWS_ILLEGAL_HTTP_CONTENT_LEN ((lws_filepos_t)-1ll)
707 unsigned char **p,
unsigned char *end);
846 const char *html_body);
862 unsigned char **p,
unsigned char *end);
941 unsigned char **p,
unsigned char *end,
char decomp);
982 #define lws_http_client_http_resp_is_error(code) (!(code < 400))
1009 #define LWS_H2_STREAM_SID -1
#define LWS_WARN_UNUSED_RESULT
unsigned long long lws_filepos_t
LWS_VISIBLE LWS_EXTERN int lws_http_compression_apply(struct lws *wsi, const char *name, unsigned char **p, unsigned char *end, char decomp)
LWS_VISIBLE LWS_EXTERN int lws_http_mark_sse(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_http_date_parse_unix(const char *b, size_t len, time_t *t)
LWS_VISIBLE LWS_EXTERN int lws_serve_http_file_fragment(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_http_check_retry_after(struct lws *wsi, lws_usec_t *us_interval_in_out)
LWS_VISIBLE LWS_EXTERN int lws_chunked_html_process(struct lws_process_html_args *args, struct lws_process_html_state *s)
const char *(* lws_process_html_state_cb)(void *data, int index)
lws_process_html_state_cb replace
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_redirect(struct lws *wsi, int code, const unsigned char *loc, int len, unsigned char **p, unsigned char *end)
LWS_VISIBLE LWS_EXTERN int lws_h2_get_peer_txcredit_estimate(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_http_date_render_from_unix(char *buf, size_t len, const time_t *t)
LWS_VISIBLE LWS_EXTERN int lws_urldecode(char *string, const char *escaped, int len)
LWS_VISIBLE LWS_EXTERN int lws_h2_update_peer_txcredit(struct lws *wsi, unsigned int sid, int bump)
LWS_VISIBLE LWS_EXTERN int lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, const char *other_headers, int other_headers_len)
LWS_VISIBLE LWS_EXTERN const char * lws_get_mimetype(const char *file, const struct lws_http_mount *m)
LWS_VISIBLE LWS_EXTERN const char * lws_urlencode(char *escaped, const char *string, int len)
@ HTTP_STATUS_EXPECTATION_FAILED
@ HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE
@ HTTP_STATUS_NOT_ACCEPTABLE
@ HTTP_STATUS_REQ_URI_TOO_LONG
@ HTTP_STATUS_INTERNAL_SERVER_ERROR
@ HTTP_STATUS_REQ_RANGE_NOT_SATISFIABLE
@ HTTP_STATUS_REQUEST_TIMEOUT
@ HTTP_STATUS_PROXY_AUTH_REQUIRED
@ HTTP_STATUS_BAD_REQUEST
@ HTTP_STATUS_METHOD_NOT_ALLOWED
@ HTTP_STATUS_NOT_MODIFIED
@ HTTP_STATUS_MOVED_PERMANENTLY
@ HTTP_STATUS_PARTIAL_CONTENT
@ HTTP_STATUS_REQ_ENTITY_TOO_LARGE
@ HTTP_STATUS_SERVICE_UNAVAILABLE
@ HTTP_STATUS_LENGTH_REQUIRED
@ HTTP_STATUS_PRECONDITION_FAILED
@ HTTP_STATUS_BAD_GATEWAY
@ HTTP_STATUS_NOT_IMPLEMENTED
@ HTTP_STATUS_UNAUTHORIZED
@ HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED
@ HTTP_STATUS_GATEWAY_TIMEOUT
@ HTTP_STATUS_PAYMENT_REQUIRED
LWS_VISIBLE LWS_EXTERN int lws_return_http_status(struct lws *wsi, unsigned int code, const char *html_body)
LWS_VISIBLE LWS_EXTERN int lws_http_is_redirected_to_get(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_transaction_completed(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_http_cookie_get(struct lws *wsi, const char *name, char *buf, size_t *max)
LWS_VISIBLE LWS_EXTERN int lws_http_headers_detach(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_h2_client_stream_long_poll_rxonly(struct lws *wsi)