Re: [squid-users] Squid support for CoAP ( Constrained Application Protocol)

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 07 Feb 2012 00:55:28 +1300

On 7/02/2012 12:04 a.m., parashuram wrote:
> Hello all,
>
> I am using squid as direct as well as transparent proxy, It is working
> fine for HTTP(for http:// scheme part) request,
> but I want to use squid as transparent caching proxy for HTTP and
> COAP( for coap:// scheme part). I am unable to make coap resource
> request, when i make coap request it gives fallowing response
>
<snip>
>
> <blockquote id="error">
> <p><b>Invalid URL</b></p>
> </blockquote>
>
>
<snip>
> <hr>
> <div id="footer">
> <p>Generated Mon, 06 Feb 2012 09:38:39 GMT by colinux (squid/3.1.9)</p>
> <!-- ERR_INVALID_URL -->
> </div>
> </body></html>
>
> from response I feel like squid does not support coap protocol( for
> more details go
> throughhttp://tools.ietf.org/html/draft-ietf-core-coap-08)

Correct. Squid does not support the CoAP protocol. Does not even
understand the details of how to parse coap:// scheme URL when it is
sent over HTTP.
In particular squid 3.1.9 which you are using was released just a few
weeks into the CoAP protocol design planning. So no real chance for it
there.

>
> how do I make squid to support coap protocol.

There are three "components" that could be involved in Squid:
  * CoAP-over-HTTP relay coap:// URL requests and responses to another
HTTP proxy which does the gateway handling.

This should be easy as minor alterations to the URL parser. The actual
CoAP message conversion and wrapping is left to other software.

  * HTTP-to-CoAP gateway converting HTTP coap:// URL requests to CoAP
native protocol requests

This will require creating a new component alongside the existing FTP,
Gopher, HTTP components to do all the required transport protocol
conversions.

* CoAP native protocol proxy

This will require starting with adding a new UDP receiver component
(coap_port directive) and building up the protocol handling from there.
The HTTP parsing components can be re-used for processing the HTTP-like
mime segments.
HTCP protocol is close to CoAP in transport and design requirements so
the code for HTCP could be used as an example to base the structure of
CoAP handling on.

If you want to get your hands that deep into the code to make any of
these happen I would be happy to mentor you through the development
process. If so please start with a read through
http://wiki.squid-cache.org/DeveloperResources which covers the basics
for developing Squid and links to all the useful resources we have.

Amos
Received on Mon Feb 06 2012 - 11:55:35 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 06 2012 - 12:00:01 MST