How keith-cullen/freecoap works
FreeCoAP provides CoAP message, client, and server libraries plus an HTTP/CoAP proxy. The principal proxy path accepts an HTTP connection, parses and translates the request, exchanges it with a CoAP server, and returns an HTTP response. The graph preserves the protocol libraries and proxy support layers. Several implementation files are represented only by the source index; their internal behavior and some runtime links therefore remain unverified.
Main entry points: connection.c HTTP connection · coap_client.c CoAP client · coap_server.c CoAP server · listener.c TLS listener
Components 18
CoAP protocol
- CoAP client
lib/src/coap_client.c - CoAP server
lib/src/coap_server.c - Message codec
lib/src/coap_msg.c - Memory pools
lib/src/coap_mem.c - Logging
lib/src/coap_log.c
HTTP CoAP proxy
- TLS listener
proxy/http_coap/src/listener.c - HTTP connection
proxy/http_coap/src/connection.c - Proxy parameters
proxy/http_coap/src/param.c - Proxy application
proxy/http_coap/src/proxy.c
Proxy support
- HTTP codec
proxy/common/src/http_msg.c - Protocol translation
proxy/common/src/cross.c - URI handling
proxy/common/src/uri.c - TLS services
proxy/common/src/tls.c - TLS sockets
proxy/common/src/tls_sock.c - Socket transport
proxy/common/src/sock.c - Configuration
proxy/common/src/config.c
Other components
- HTTP client
- CoAP server peer
Connections 23
- HTTP connection → CoAP client: creates client
proxy/http_coap/src/connection.c - HTTP connection → Protocol translation: translates request
proxy/http_coap/src/connection.c - HTTP connection → HTTP codec: uses parser
proxy/http_coap/src/connection.c - HTTP connection → URI handling: uses URI
proxy/http_coap/src/connection.c - HTTP client → TLS listener: opens connection
- TLS listener → HTTP connection: accepts connection
proxy/http_coap/src/listener.c - HTTP connection → CoAP server peer: sends CoAP request
- Proxy application → TLS listener: starts listener
proxy/http_coap/src/proxy.c - Proxy application → Proxy parameters: loads settings
proxy/http_coap/src/proxy.c - Proxy application → TLS services: initializes TLS
proxy/http_coap/src/proxy.c - TLS listener → TLS sockets: accepts TLS sockets
proxy/http_coap/src/listener.c - TLS sockets → TLS services: uses TLS
- TLS sockets → Socket transport: uses sockets
- CoAP client → Message codec: uses messages
- CoAP server → Message codec: uses messages
- Message codec → Memory pools: allocates buffers
lib/src/coap_msg.c - CoAP client → Memory pools: uses allocator
lib/src/coap_client.c - CoAP server → Memory pools: uses allocator
lib/src/coap_server.c - CoAP client → Logging: logs events
lib/src/coap_client.c - CoAP server → Logging: logs events
lib/src/coap_server.c - Protocol translation → URI handling: uses URI
proxy/common/src/cross.c - HTTP codec → Configuration
- CoAP server peer → CoAP server: serves requests