Regarding CoAP Client proxy funtionality

320 Views Asked by At

I'm developing CoAP Client proxy funtionailty. But, I'm confused the spec and how it works. What I'm confused as the following:

  1. Proxy-URI option

    1.1 Which coap server can be connected if Proxy-URI option is setup?

    1.2 Should CoAP request message include URI-* options if there is Proxy-URI option? As far as I know, the URI-* options should be included. But, the URI-* options are skipped in libcoap code.

  2. Proxy-Scheme option

    2.1 How to construct URI-* options if proxy-scheme option is present? If it's present, normal URI-* options should be skipped or not?

1

There are 1 best solutions below

1
chrysn On BEST ANSWER

ad 1.2: The Proxy-Uri and the other Uri-* options are mutually exclusive. There can be either a Proxy-Uri or any combination of Uri-* options. Think of the Proxy-Uri option as an alternative representation of (Proxy-Scheme, Uri-Host, Uri-Port, ...), and whenever possible avoid using Proxy-Uri.

ad 2: The presence of Proxy-Scheme just indicates that the client is asking for this request to be forwarded, and which protocol to use in forwarding (CoAP-over-UDP? CoAP-over-TCP? Even HTTP in a cross proxy?). For most proxy cases, you look into the Uri-Host option to decide which next hop to take. The forwarded message contains no Proxy-Scheme any more but only the Uri-* options, exactly as they were in the original request.