COAP-RD(5)

πŸ’… COAP-RD(5) β€” the coap-rd manual, bestie edition πŸŽ€

okay so quick vibe check: this is the manual for coap-rd (and its whole little friend group: coap-rd-gnutls, coap-rd-mbedtls, coap-rd-openssl, coap-rd-notls) β€” sitting in section 5 of the manual, living its best life. grab a boba, we're doing this. πŸ§‹βœ¨


🌸 NAME 🌸

coap-rd, coap-rd-gnutls, coap-rd-mbedtls, coap-rd-openssl, coap-rd-notls β€” a CoAP Resource Directory built on libcoap. literally the whole squad. πŸ’…


✨ SYNOPSIS ✨

coap-rd [-g group] [-p port] [-v num] [-w [port][,secure_port]] [-A
address] [-G group_if] [-T max_token_size] [-V num] [[-h hint] [-k key]]
[[-c certfile] [-n] [-C cafile] [-R trusted_casfile]]

so here's the tea β˜• β€” depending on which (D)TLS library your libcoap got compiled against, you might get coap-rd-notls, coap-rd-gnutls, coap-rd-openssl, coap-rd-mbedtls or coap-rd-tinydtls as separate binaries. and if none of those are around? no stress, plain old coap-rd just rolls with the default libcoap (D)TLS support. πŸ¦‹


πŸ¦‹ DESCRIPTION πŸ¦‹

coap-rd is a simple CoAP Resource Directory server β€” and when we say simple we mean it's not doing the most, it's just doing its job. it handles resource registrations using the protocol CoAP (RFC 7252). that's it, that's the gig. iconic behavior honestly. πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • -g group β€” joins the multicast group you name, right at startup. 🫢 note: DTLS over multicast is not currently supported, so don't come for it.
  • -p port β€” the port on the given address that's listening for incoming connections. if (D)TLS is supported, then port + 1 also gets listened on for (D)TLS connections. the default port is 5683 if you don't give it anything else. slay.
  • -v num β€” the verbosity level for general CoAP logging. default is 4, maximum is 8. (yes there is a ceiling, bestie.)
  • -w [port][,secure_port] β€” turns on WebSockets support on port (WS) and/or secure_port (WSS), comma separated. two for one, we love to see it. ✨
  • -A address β€” the local address of the interface the server has to listen on. this is your main character address. πŸ’…
  • -G group_if β€” use this interface for listening for the multicast group. this can be different from the implied interface if the -A option is used. yes, they can be two different things, keep up. πŸ™ˆ
  • -T max_token_size β€” sets the maximum token length (8–65804). that is a very specific range and we respect it.
  • -V num β€” verbosity level for (D)TLS library logging. default is 3, maximum is 7. (different numbers than -v, don't @ me, that's just how it is.)

πŸ” OPTIONS - PSK πŸ”

(if supported by the underlying (D)TLS library β€” if, okay? check first πŸŽ€)

  • -h hint β€” the Identity Hint to send. default is CoAP. zero length means no hint at all.
  • -k key β€” the pre-shared key to use for inbound connections. this cannot be empty if defined. 🫢 note: if -c cafile is defined, you need to define -k key as well to have the server support both PSK and PKI. both or nothing, babe.

🌈 OPTIONS - PKI 🌈

(again: if supported by the underlying (D)TLS library πŸ’œ)

  • -c certfile β€” use the specified PEM file, which contains the CERTIFICATE and PRIVATE KEY information. 🫢 note: if -k key is defined, you need to define -c certfile as well to have the server support both PSK and PKI. (it's giving mutual commitment.)
  • -n β€” disables remote peer certificate checking. this gives clients the ability to use PKI, but without any defined certificates. convenient? yes. a little unhinged? also yes. 😭
  • -C cafile β€” a PEM file that contains a list of one or more CAs that are to be passed to the client so the client can figure out which client certificate to use. normally this list of CAs would be the root CA plus any intermediate CAs. ideally the server certificate should be signed by the same CA so mutual authentication can actually happen. the contents of cafile get added to the trusted store of root CAs. using the -C or -R options will trigger the validation of the client certificate unless overridden by the -n option. πŸ‘‘
  • -R trust_casfile β€” a PEM file containing the set of trusted root CAs that are to be used to validate the client certificate. alternatively, this can point to a directory containing a set of CA PEM files. the -C cafile CA doesn't have to be in this list and is trusted for the validation. using -R trust_casfile disables common CA mutual authentication, which can only be done by using -C cafile. using the -C or -R options will trigger the validation of the server certificate unless overridden by the -n option. (this one's a little dramatic, read it twice. πŸ’€)

πŸ“ EXAMPLES πŸ“

  • Example
coap-rd -A ::1

lets the server listen on localhost (port 5683). baby's first server. 🐣

  • Example
coap-rd -A ::1 -k mysecretKey -h myhint

lets the server listen on localhost (port 5683 and 5684) with the server set up for PSK authentication. two ports, one server, main character energy. ✨

  • Example
coap-rd -A ::1 -p 13011

quite the same, except the listening port is 13011 (and not the default port 5683). we're customizing today, bestie. πŸŽ€

  • Example
coap-rd -A 2001:db8:81a8:0:6ef0:dead:feed:beef  -v 5

the listening address is set to 2001:db8:81a8:0:6ef0:dead:feed:beef and the verbosity level is set to 5. look at that address, it ate. πŸ”₯

  • Example
coap-rd -A 2001:db8:81a8:0:6ef0:dead:feed:beef  -g FF02::FD

sets the listening address to 2001:db8:81a8:0:6ef0:dead:feed:beef and joins the All CoAP Nodes multicast group FF02::FD. group chat, but make it multicast. 🫢


🧚 FILES 🧚

there are no configuration files. nothing to edit, nothing to break, nothing to obsess over. it's giving minimalism. ✨


πŸ‘‘ EXIT STATUS πŸ‘‘

  • 0 β€” Success. slay, it worked. πŸ’–
  • 1 β€” Failure (syntax or usage error; configuration error; document processing failure; unexpected error). something went sideways, five separate ways possible, take your pick. 😭

πŸ’€ BUGS πŸ’€

found a bug? please raise an issue on GitHub at https://github.com/obgm/libcoap/issues so it can be reported. 🫢

got a fix instead? please raise a Pull Request at https://github.com/obgm/libcoap/pulls so it can be fixed. we love a problem-solver. πŸ”₯


🌟 AUTHORS 🌟

The libcoap project <libcoap-developers@lists.sourceforge.net> β€” the actual icons behind all of this. πŸ‘‘


and that's the whole page, bestie πŸ¦‹βœ¨ β€” this was coap-rd version 4.3.5, dated 08/24/2026, and that's a wrap on section 5. go forth and register some resources. πŸ’…πŸŽ€

πŸ“¦ where this page comes from