libcoap 4.3.4-develop-04b239f
coap_websockets(3)
coap_websockets

SYNOPSIS

#include <coap3/coap.h>

int coap_ws_is_supported(void);

int coap_wss_is_supported(void);

int coap_ws_set_host_request(coap_session_t *session, coap_str_const_t *ws_host);

DESCRIPTION

This man page describes the additional libcoap functions that are available for working with the optional WebSockets support.

CoAP Servers can be set up to listen for incoming WebSockets requests, and CoAP Clients can initiate WebSockets requests using the CoAP schemes coap_ws:// and coaps+ws://.

FUNCTIONS

Function: coap_ws_is_supported()

The coap_ws_is_supported() function is used to determine whether WebSockets support is available in libcoap.

Function: coap_wss_is_supported()

The coap_wss_is_supported() function is used to determine whether Secure WebSockets support is available in libcoap.

Function: coap_ws_set_host_request()

The coap_ws_set_host_request() function is used to set ws_host as the HTTP Host: for the session in a WebSockets request.

RETURN VALUES

coap_ws_is_supported() returns 0 if there is no support, 1 if support is available.

coap_wss_is_supported() returns 0 if there is no support, 1 if support is available.

coap_ws_set_host_request() returns 1 if successful, else 0 if a failure.

SEE ALSO

coap_uri(3)

BUGS

Please report bugs on the mailing list for libcoap: libcoap-developers@lists.sourceforge.net or raise an issue on GitHub at https://github.com/obgm/libcoap/issues

AUTHORS

The libcoap project <libcoap-developers@lists.sourceforge.net>

coap_websockets(3)