Sponsor:

Your company here ā€” click to reach over 10,000 unique daily visitors

coap_websockets - Man Page

Work with 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)

Further Information

See

"RFC7252: The Constrained Application Protocol (CoAP)"

"RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets"

for further information.

Bugs

Please raise an issue on GitHub at https://github.com/obgm/libcoap/issues to report any bugs.

Please raise a Pull Request at https://github.com/obgm/libcoap/pulls for any fixes.

Authors

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

Referenced By

coap(7), coap_endpoint_client(3), coap_endpoint_server(3).

The man pages coap_ws_is_supported(3), coap_ws_set_host_request(3) and coap_wss_is_supported(3) are aliases of coap_websockets(3).

06/07/2024 coap_websockets 4.3.5rc1 libcoap Manual