|
SatCat5
|
Define a reverse-proxy CoAP resource.
Definition at line 51 of file coap_proxy.h.
#include <coap_proxy.h>
Public Member Functions | |
| ProxyResource (satcat5::coap::ProxyServer *server, const char *local_uri, const satcat5::ip::Addr &fwd_addr, const satcat5::udp::Port &fwd_port, const char *fwd_uri=nullptr) | |
| Constructor sets the URI path for the resource. More... | |
| bool | request_get (Connection *obj, Reader *msg) override |
| Forward GET, POST, PUT, and DELETE requests. More... | |
| bool | request_post (Connection *obj, Reader *msg) override |
| Forward GET, POST, PUT, and DELETE requests. More... | |
| bool | request_put (Connection *obj, Reader *msg) override |
| Forward GET, POST, PUT, and DELETE requests. More... | |
| bool | request_delete (Connection *obj, Reader *msg) override |
| Forward GET, POST, PUT, and DELETE requests. More... | |
| bool | operator== (const Resource &other) const |
| Comparison operators for comparing two URI-paths. | |
| bool | operator!= (const Resource &other) const |
| Comparison operators for comparing two URI-paths. | |
| satcat5::ip::Dispatch * | ip () const |
| Pointer to the parent's network interface. | |
| satcat5::udp::Dispatch * | udp () const |
| Pointer to the parent's network interface. | |
Protected Member Functions | |
| bool | request_any (Connection *obj, Reader *msg) |
| Event handler for all incoming requests. More... | |
Static Protected Member Functions | |
| static constexpr const char * | normalize_uri (const char *uri) |
| Remove leading slash from a user-provided path. | |
Protected Attributes | |
| satcat5::coap::ProxyServer *const | m_pool |
| const satcat5::ip::Addr | m_fwd_addr |
| const satcat5::udp::Port | m_fwd_port |
| const char *const | m_fwd_uri |
| const char *const | m_uri_path |
| URI-Path for this resource. | |
| ResourceServer *const | m_server |
| Optional pointer to the server object. | |
Private Attributes | |
| Resource * | m_next |
| ProxyResource::ProxyResource | ( | satcat5::coap::ProxyServer * | server, |
| const char * | local_uri, | ||
| const satcat5::ip::Addr & | fwd_addr, | ||
| const satcat5::udp::Port & | fwd_port, | ||
| const char * | fwd_uri = nullptr |
||
| ) |
Constructor sets the URI path for the resource.
| server | Pointer to the CoAP server object. |
| local_uri | URI for incoming requests. |
| fwd_addr | Forwarding IP address. |
| fwd_port | Forwarding UDP port. |
| fwd_uri | Optional forwarding URI, if different. |
Definition at line 32 of file coap_proxy.cc.
|
protected |
Event handler for all incoming requests.
(The GET/POST/PUT/DELETE code is forwarded verbatim.)
Definition at line 47 of file coap_proxy.cc.
|
inlineoverridevirtual |
Forward GET, POST, PUT, and DELETE requests.
Each handler is aliased to the same underlying function.
Reimplemented from satcat5::coap::Resource.
Definition at line 75 of file coap_proxy.h.
|
inlineoverridevirtual |
Forward GET, POST, PUT, and DELETE requests.
Each handler is aliased to the same underlying function.
Reimplemented from satcat5::coap::Resource.
Definition at line 69 of file coap_proxy.h.
|
inlineoverridevirtual |
Forward GET, POST, PUT, and DELETE requests.
Each handler is aliased to the same underlying function.
Reimplemented from satcat5::coap::Resource.
Definition at line 71 of file coap_proxy.h.
|
inlineoverridevirtual |
Forward GET, POST, PUT, and DELETE requests.
Each handler is aliased to the same underlying function.
Reimplemented from satcat5::coap::Resource.
Definition at line 73 of file coap_proxy.h.