Revision as of 14:51, 20 February 2018 by Muscariello (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

HTTP Server over TCP/ICN

This is an implementation of a HTTP proxy server able to serve client requests using both TCP and ICN as transport protocol. This project is a fork from the http server implemented by Ole Christian Eidheim and open sourced at distributed under the MIT license. In the ICN flavour, so far, we support the GET method. The current application is used in end devices to to proxy HTTP apps that do not use ICN natively.


  • libboost-regex-dev
  • libboost-system-dev
  • libboost-filesystem-dev
  • libicnet
  • libcurl

Install the HTTP-Server

Installation from binary packages

Ubuntu 14.04 and Ubuntu 16.04

 $ echo "deb [trusted=yes]$(lsb_release -sc).main/ ./" \
          | sudo tee -a /etc/apt/sources.list.d/
 $ sudo apt-get update
 $ sudo apt-get install http-server

Centos 7

$ cat << EOF | sudo tee -a /etc/yum.repos.d/
[fdio-cicn-master] master branch latest merge
$ sudo yum install http-server

Installation from source code

For installing the application:

$ mkdir build && cd build
$ cmake ..
$ make
$ sudo make install


For starting the http-server, from the build folder:

$ cd build
$ ./http-server

The server now is:

  • Serving files from the folder /var/www/html
  • Listening on the prefix http://webserver
  • Listening on the TCP port 8080

For retrieving a content through icn, the name must have the following format:

$ iget http://webserver/file.mp4

The application iget is available in the package libicnet.

The server accept three option through the command line:

$ ./http-server -h

The default values for the first two parameters are /var/www/html for the root folder and http://webserver as icn prefix served.

The http-server can also be used as a transparent proxy: if the resources to retrieve are stored in a remote location and they are available over http, it is possible to retrieve them by specifying their location when starting the http-server, in this way:

 $ ./http-server -x

The server will perform the following operations:

  • When it receives the first client request, it will look for the asked resource locally
  • If the resource is not available, it will forward the HTTP request to the remote origin
  • The remote origin will reply with the content (or with an error code)
  • The reply will be forwarded to the client


Http-server has been tested in:

  • Ubuntu 16.04 (x86_64)
  • Ubuntu 14.04 (x86_64)
  • Debian Testing
  • MacOSX 10.12
  • CentOS 7