|
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_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_WARN_UNUSED_RESULT | lws_http_transaction_completed (struct lws *wsi) |
|
Modules related to handling HTTP
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 |
|
) |
| |
#include <lib/libwebsockets.h>
lws_http_redirect() - write http redirect into buffer
- Parameters
-
wsi | websocket connection |
code | HTTP response code (eg, 301) |
loc | where to redirect to |
len | length of loc |
p | pointer current position in buffer (updated as we write) |
end | pointer to end of buffer |
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_http_transaction_completed |
( |
struct lws * |
wsi | ) |
|
#include <lib/libwebsockets.h>
lws_http_transaction_completed() - wait for new http transaction or close
- Parameters
-
wsi | websocket connection Returns 1 if the HTTP connection must close now
Returns 0 and resets connection to wait for new HTTP header /
transaction if possible |
LWS_VISIBLE LWS_EXTERN int lws_return_http_status |
( |
struct lws * |
wsi, |
|
|
unsigned int |
code, |
|
|
const char * |
html_body |
|
) |
| |
#include <lib/libwebsockets.h>
lws_return_http_status() - Return simple http status
- Parameters
-
wsi | Websocket instance (available from user callback) |
code | Status index, eg, 404 |
html_body | User-readable HTML description < 1KB, or NULL Helper to report HTTP errors back to the client cleanly and
consistently |