aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: a317c80c6505d62d1a2d1323d24c25278808192d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
HTTP Server over TCP/ICN
====================================================
This is an implementation of a HTTP 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 https://github.com/eidheim/Simple-Web-Server.

In the ICN flavour, so far, we support just the GET method. Later we'll be implementing the
remaining methods as well.

Dependencies
------------

- libboost-regex-dev
- libboost-system-dev
- libboost-filesystem-dev
- libicnet

Build the HTTP-Server
-----------------

For building the library, from the root folder of the project:
 
```bash
 $ mkdir build && cd build 
 $ cmake ..
 $ make
```

Install the HTTP-Server
-------------------

For installing the application:

```bash
 $ cd build
 $ sudo make install
```

Usage
-----

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

```bash
 $ cd build
 $ ./http-server
```

The server now is:
- serving files from the folder **/var/www/html**
- Listening on the icn name /webserver
- Listening on the TCP port 8080

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

`iget http://webserver/get/file.mp4`

The server accept two option through the command line:

```bash
 $ ./http-server -h
 http-server [-p PATH_TO_ROOT_FOOT_FOLDER] [-l WEBSERVER_PREFIX]
```

The default values are **/vaw/www/html** for the root folder and **ccnx:/webserver** for the icn name. 

Platforms
---------

Libicnet has been tested in:

    - Ubuntu 16.04 (x86_64)
    - Debian Testing
    - MacOSX 10.12