COAP_WEBSOCKETS(3)

πŸ‘‘ COAP_WEBSOCKETS(3) πŸ‘‘

okay so bestie, welcome to the libcoap Manual ✨ β€” this is the page about coap_websockets and coap_ws_set_host_request, aka the Work with CoAP WebSockets era of your life πŸ’…


🌸 SYNOPSIS 🌸

like, just include the header first, obviously:

#include <coap3/coap.h>

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

that's it, that's the whole vibe πŸŽ€


πŸ’– DESCRIPTION πŸ’–

okay so this man page is describing the additional libcoap functions that exist for working with the optional WebSockets support 🌈. optional, bestie β€” it's giving "you have to opt in" energy, iykyk.

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:// πŸ”₯. yes those are real, write them down, no cap.


πŸ¦‹ FUNCTIONS πŸ¦‹

Function: coap_ws_set_host_request()

so the coap_ws_set_host_request() function is literally the one that sets ws_host as the HTTP Host: for the session in a WebSockets request πŸ’…. that's the whole job. it ate and left no crumbs.


⭐ RETURN VALUES ⭐

coap_ws_set_host_request() returns 1 if successful 😌✨, else 0 if a failure 😭. binary queen. no in-between.


🫢 SEE ALSO 🫢

go read these next, bestie, they're iconic:


🧚 FURTHER INFORMATION 🧚

See πŸ‘€

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

for further information πŸ“šβœ¨. yes, actual reading. you got this 🫢


πŸ’€ BUGS πŸ’€

found something cursed? Please raise an issue on GitHub at https://github.com/obgm/libcoap/issues to report any bugs πŸ›πŸ™ˆ

and if you've got the fix? Please raise a Pull Request at https://github.com/obgm/libcoap/pulls for any fixes πŸ’…πŸ”₯. main character energy fr fr.


🌺 AUTHORS 🌺

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


and that's the page, bestie πŸ’– β€” brought to you by coap_websockets 4.3.5, dated 08/24/2026, signing off with a little sparkle πŸŽ€βœ¨πŸŒΈ

πŸ“¦ where this page comes from