'\" t .\" Title: coap_websockets .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/28/2023 .\" Manual: libcoap Manual .\" Source: coap_websockets 4.3.4 .\" Language: English .\" .TH "COAP_WEBSOCKETS" "3" "10/28/2023" "coap_websockets 4\&.3\&.4" "libcoap Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" coap_websockets, coap_ws_is_supported, coap_wss_is_supported, coap_ws_set_host_request \- Work with CoAP WebSockets .SH "SYNOPSIS" .sp \fB#include \fR .sp \fBint coap_ws_is_supported(void);\fR .sp \fBint coap_wss_is_supported(void);\fR .sp \fBint coap_ws_set_host_request(coap_session_t *\fR\fB\fIsession\fR\fR\fB, coap_str_const_t *\fR\fB\fIws_host\fR\fR\fB);\fR .SH "DESCRIPTION" .sp This man page describes the additional libcoap functions that are available for working with the optional WebSockets support\&. .sp 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://\&. .SH "FUNCTIONS" .sp \fBFunction: coap_ws_is_supported()\fR .sp The \fBcoap_ws_is_supported\fR() function is used to determine whether WebSockets support is available in libcoap\&. .sp \fBFunction: coap_wss_is_supported()\fR .sp The \fBcoap_wss_is_supported\fR() function is used to determine whether Secure WebSockets support is available in libcoap\&. .sp \fBFunction: coap_ws_set_host_request()\fR .sp The \fBcoap_ws_set_host_request\fR() function is used to set \fIws_host\fR as the HTTP Host: for the \fIsession\fR in a WebSockets request\&. .SH "RETURN VALUES" .sp \fBcoap_ws_is_supported\fR() returns 0 if there is no support, 1 if support is available\&. .sp \fBcoap_wss_is_supported\fR() returns 0 if there is no support, 1 if support is available\&. .sp \fBcoap_ws_set_host_request\fR() returns 1 if successful, else 0 if a failure\&. .SH "SEE ALSO" .sp \fBcoap_uri\fR(3) .SH "FURTHER INFORMATION" .sp See .sp "RFC7252: The Constrained Application Protocol (CoAP)" .sp "RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets" .sp for further information\&. .SH "BUGS" .sp 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 .SH "AUTHORS" .sp The libcoap project