0

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?

chrysn
  • 810
  • 6
  • 19
Jang
  • 150
  • 1
  • 2
  • 10
  • Please clarify question 1.1. Be connected to from where, and which kind of setup comes into play? – chrysn Oct 02 '19 at 01:16
  • I think CoAP client connects coap server. Which coap server can be connected If URI is "192.168.0.1" and Proxy-URI is "192.168.0.2"? – Jang Oct 04 '19 at 00:13
  • I guess, the most implementation just lack of supporting proxies by a comfortable client API. Set the URI with the "final" destination. If the protocol should be changed, add that to the proxy-scheme. If the destination URI could not be expressed by the elements of an CoAP URI, use the Proxy URI instead. Then, don't send that request to the destination provided in the URI, instead, send it to the proxy. For californium, set the destination context of the request with the proxy's address. – Achim Kraus Oct 04 '19 at 13:39
  • Just to ask: are you interested in contribute your client extension for the open source project eclipse/californium? – Achim Kraus Oct 04 '19 at 13:55
  • Is there a good reference document about the CoAP-CoAP and the HTTP-CoAP proxy operation? – Stefan Dec 12 '19 at 16:52
  • The reference document is in RFC7252 and RFC8075. Eclipse/Californium includes in the meantime a redesigned proxy2, see https://github.com/eclipse/californium/tree/master/californium-proxy2 for more details. – Achim Kraus Dec 07 '20 at 17:16

1 Answers1

2

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.

chrysn
  • 810
  • 6
  • 19
  • Thanks for your comments. I checked the proxy functionality with Firefox's Copper plug-in. When I add Proxy-Uri option, the request includes Proxy-Uri option and connect the Uri-Host. If Proxy-Scheme option is setup, the Proxy-Uri is added into Uri-Path option. That's why I'm confused. – Jang Oct 04 '19 at 00:24