CoAP Proxy Workbench

Animate RFC 7252 forward proxies, reverse proxies, cache freshness, Proxy-Uri, Proxy-Scheme, and HTTP/CoAP cross-proxy translation.

animation
coap
protocols
proxy
caching
protocol-translation
interactive
Interactive CoAP proxy workbench for learning forward proxy requests, reverse proxy namespace mapping, CoAP/HTTP cross-proxy translation, cache freshness, ETag revalidation, gateway errors, and security boundaries.
CoAP Proxying Caching RFC 7252

CoAP Proxy Workbench

Follow a request through a constrained-network proxy. Compare forward proxy requests that carry Proxy-Uri, reverse proxy namespace mapping, cache hits, ETag revalidation, and HTTP/CoAP cross-proxy translation.

Proxy role Forward proxy
Cache decision Miss, forward
Upstream leg CoAP to origin
Client result 2.05 Content
Animated exchange

Client, proxy, and origin flow

A forward proxy consumes the proxy option, builds an origin request, and returns the origin response or a cache response.

Step 1 of 5
CoAP proxy request flow A packet moves between client, proxy, and origin server, with separate request, response, and cache decision paths. Client CoAP endpoint CON GET / waiting for response Proxy forward proxy parse Proxy-Uri cache lookup build origin request Origin CoAP resource GET /temp 2.05 Content Proxy cache key: GET coap://.../temp REQ

Client sends proxy request

The client sends a normal CoAP message to the proxy endpoint, but the target resource is carried in a proxy option.

Progress

Packet and option inspector

Compare what arrives at the proxy with what is forwarded to the origin. Forward-proxy options are not blindly passed onward.

Translation and response mapping

Cross-proxies map application semantics. CoAP CON/NON message mechanics stay on the CoAP side and are not exposed as HTTP behavior.

Incoming CoAP GET with Proxy-Uri
Outgoing CoAP GET with Uri-Host and Uri-Path
Response 2.05 Content with Max-Age and ETag

Proxy state

The same request can produce a network fetch, a cache hit, a validation request, or a gateway error depending on freshness and proxy support.

Stored response 23.6 C, ETag 0x7a

Cacheable 2.05 Content response.

Freshness 18 s / 60 s

Max-Age remaining is reduced before sending cached responses.

Security boundary Client-proxy leg

Secure URI requests should use DTLS, or equivalent security, to the proxy.

Energy effect One origin trip

Cache hits avoid waking the constrained sensor for repeat GETs.

Event trace

Read the flow as a proxy implementer: option parsing, cache lookup, upstream request, response code mapping, and returned Max-Age.

Beginner ramp

What is being proxied?

A client asks a proxy to retrieve or update a resource somewhere else. The proxy is a CoAP endpoint, not just a packet forwarder.

Why use one?

It can bridge protocols, hide constrained devices behind a gateway, cache safe responses, and enforce a security boundary.

What should you watch?

Watch where the URI is named, whether the proxy contacts the origin, and whether the response code is generated by the origin or proxy.

Quick Reference: CoAP proxy segments
Technical accuracy notes

Forward proxy URI handling

  • Proxy-Uri is an absolute URI and takes precedence over Uri-Host, Uri-Port, Uri-Path, and Uri-Query.
  • Proxy-Scheme can construct the absolute URI from split URI options when the target can be expressed that way.
  • The proxy consumes Proxy-Uri or Proxy-Scheme; it is not forwarded to the origin server in a normal CoAP-to-CoAP proxy exchange.

Caching and freshness

  • CoAP cacheability depends on the response code. A successful 2.05 Content response to GET is cacheable.
  • Max-Age defaults to 60 seconds if omitted; Max-Age: 0 prevents reuse without revalidation.
  • A proxy-generated cache response must not extend the original Max-Age. It should subtract the age already spent in cache.

Proxy responsibility

  • Unrecognized unsafe request options cause 4.02 Bad Option at the proxy.
  • Origin timeout maps to 5.04 Gateway Timeout; an unprocessable origin response maps to 5.02 Bad Gateway.
  • Cross-proxies map request and response semantics; CoAP message type details do not become HTTP features.
Independent practice

Identify the proxy role

If the client explicitly names the origin in Proxy-Uri, it is using a forward proxy. If the proxy maps its own resource path to an internal server, it is acting as a reverse proxy.

Predict cache behavior

Set cached age lower than Max-Age and step the fresh-cache scenario. Then increase age beyond Max-Age and compare the revalidation scenario.

Trace failure ownership

Use the timeout and unsafe-option scenarios to separate errors generated by the proxy from errors returned by the origin resource.