User Tools

Site Tools


coap-http_proxy

CoAP - HTTP Proxy


Goal:

  1. To build the connection between the Web and the Web of Things by allowing CoAP clients to interact with resources from HTTP servers
  2. Reusable native stack across multiple platforms (Linux, Android, iOS, Tizen ..)
  3. Compliance to OCF resource model with ability to support both OCF and Vendor Specific resources exposed by HTTP servers.

Overview:

Use Cases:

Proposed Architecture:

CoAP – HTTP Mapping: Contains mapping between CoAP and HTTP Request, Response and Error codes.

CoAP Request - HTTP Response Handler: Implements conversion of CoAP request to HTTP request and HTTP response to CoAP response with help of “CoAP-HTTP Mapping” module.

HTTP Parser: Implements functionality of parsing HTTP responses.

HTTP Client: Implements functionality of generating HTTP requests.

TCP Client: Implements TCP client to interact with HTTP servers.

Sequence Diagram:

How To Run ?

Code Location: Code for proxy can be found at: <path_to_IoTivity> /service/coap-http-proxy

Supported Platform: Proxy service is currently supported on Linux while a client for proxy can run on any IoTivity supported platform.

Build Dependency: Proxy is developed using curl HTTP client library (https://curl.haxx.se/libcurl/). In case your Linux box is missing libcurl, please install it using:

  1. sudo apt-get install libcurl-dev

or

  1. sudo apt-get install libcurl4-openssl-dev

For alternatives to openssl, please refer: https://curl.haxx.se/docs/ssl-compared.html

Build Instructions:

To build proxy, please use following command:

  1. cd <path_to_IoTivity>
  2. scons TARGET_OS=linux WITH_PROXY=true

This will build CoAP-HTTP Proxy service along with other IoTivity services and base layer.

To run proxy service, please launch:

  1. ./out/linux/x86/debug/service/coap-http-proxy/samples/proxy_main

To launch proxy client, please launch:

  1. ./out/linux/x86/debug/service/coap-http-proxy/samples/proxy_client -t <1..5> -p “<http_uri>”
coap-http_proxy.txt · Last modified: 2016/09/16 13:06 by Abhishek Sharma