CoAP Forward Proxy Requests: Proxy-Uri vs. Proxy-Scheme
Address the CoAP proxy endpoint while describing the onward resource with Proxy-Uri or Proxy-Scheme, and handle options the proxy cannot safely forward.
A CoAP forward-proxy request is sent to the proxy's CoAP endpoint. The target resource is described separately:
proxy endpoint: coap://proxy.example:5683
Proxy-Uri option: coap://sensor.example/temperature
These are logical values, not an HTTP request line. Proxy-Uri carries the absolute target URI. Alternatively, Proxy-Scheme combines a scheme with the split Uri-* options.
Do not combine Proxy-Uri with Uri-Host, Uri-Port, Uri-Path or Uri-Query. The full-URI representation and split representation are different encodings of the onward target. Proxy-Uri and Proxy-Scheme must not appear together.
The proxy processes all request options. An unrecognized Unsafe option produces 4.02 Bad Option, because forwarding without understanding it can change the request's meaning. A CoAP-to-CoAP proxy must preserve unrecognized Safe-to-Forward options.
When sending to the origin, the proxy consumes the proxy-target option and constructs the origin request's URI options. It also owns its exchanges on each side; this is not blind forwarding of the original UDP datagram.
An endpoint unable or unwilling to proxy the requested URI returns 5.05 Proxying Not Supported. That is a protocol response, not proof that the listener was unreachable.