-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add submodules for easier install, improve Makefiles, documentation a…
…nd fix bugs in example programs
- Loading branch information
Nicolas Mora
committed
Jun 1, 2016
1 parent
f5816f8
commit 62f71b9
Showing
24 changed files
with
325 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "lib/orcania"] | ||
path = lib/orcania | ||
url = git@github.com:babelouest/orcania.git | ||
[submodule "lib/yder"] | ||
path = lib/yder | ||
url = git@github.com:babelouest/yder.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# | ||
# Example program | ||
# | ||
# Makefile used to build all programs | ||
# | ||
# Copyright 2014-2015 Nicolas Mora <mail@babelouest.org> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the MIT License | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
|
||
SIMPLE_EXAMPLE_LOCATION=./simple_example | ||
SHEEP_COUNTER_LOCATION=./sheep_counter | ||
PROXY_EXAMPLE_LOCATION=./proxy_example | ||
REQUEST_EXAMPLE_LOCATION=./request_example | ||
TEST_U_MAP_LOCATION=./test_u_map | ||
INJECTION_EXAMPLE_LOCATION=./injection_example | ||
AUTH_EXAMPLE_LOCATION=./auth_example | ||
STREAM_EXAMPLE_LOCATION=./stream_example | ||
|
||
all: debug | ||
|
||
debug: | ||
cd $(SIMPLE_EXAMPLE_LOCATION) && $(MAKE) debug | ||
cd $(PROXY_EXAMPLE_LOCATION) && $(MAKE) debug | ||
cd $(REQUEST_EXAMPLE_LOCATION) && $(MAKE) debug | ||
cd $(INJECTION_EXAMPLE_LOCATION) && $(MAKE) debug | ||
cd $(AUTH_EXAMPLE_LOCATION) && $(MAKE) debug | ||
cd $(STREAM_EXAMPLE_LOCATION) && $(MAKE) debug | ||
cd $(TEST_U_MAP_LOCATION) && $(MAKE) debug | ||
|
||
clean: | ||
cd $(SIMPLE_EXAMPLE_LOCATION) && $(MAKE) clean | ||
cd $(SHEEP_COUNTER_LOCATION) && $(MAKE) clean | ||
cd $(PROXY_EXAMPLE_LOCATION) && $(MAKE) clean | ||
cd $(REQUEST_EXAMPLE_LOCATION) && $(MAKE) clean | ||
cd $(INJECTION_EXAMPLE_LOCATION) && $(MAKE) clean | ||
cd $(AUTH_EXAMPLE_LOCATION) && $(MAKE) clean | ||
cd $(STREAM_EXAMPLE_LOCATION) && $(MAKE) clean | ||
cd $(TEST_U_MAP_LOCATION) && $(MAKE) clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Ulfius Franework example programs | ||
|
||
Those programs require ulfius to be installed with its dependencies. To do so, in the root folder, run `make && sudo make install` to compile and install the library. Refer to the `README.md` for more information. | ||
|
||
Each program implement some functionalities provided by Ulfius, such as url parsing, request filling and response manipulation. For each example program, you can look at its `README.md`. In general, a simple `make ` or `make test` is sufficient to run the example program. | ||
|
||
## Example programs available | ||
|
||
The example programs were developped to help implementing the functionnalities of the framework and test them. The tested functionnalities are: | ||
|
||
- `simple_example`: endpoint tests, url parameters, body parameters, json body parameters and cookies | ||
- `sheep_counter`: file server, upload file | ||
- `injection_example`: endpoints injection and remove during the program execution | ||
- `proxy_example`: proxyfies calls to anither url | ||
- `auth_example`: HTTP Basic Auth | ||
- `stream_example`: data streaming (server and client side) | ||
- `request_example`: send http and smtp requests | ||
- `test_u_map`: struct _u_map tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Authentication example | ||
|
||
Provides an application that implement basic authentication | ||
|
||
## Compile and run | ||
|
||
```bash | ||
$ make | ||
$ ./auth_server | ||
``` | ||
|
||
## Usage | ||
|
||
Open in your browser the url `http://localhost:2884/auth/basic`, then on the authentication prompt, enter the `USER` and `PASSWORD` specified in `auth_server.c` (default test/testpassword) to be authenticated and allowed to access the endpoint. | ||
|
||
In another console, you can run the client program to test the use cases | ||
|
||
```bash | ||
$ ./auth_client | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Injection example | ||
|
||
Provides an example program that will add and remove endpoints during the execution | ||
|
||
## Compile and run | ||
|
||
```bash | ||
$ make test | ||
``` | ||
|
||
## Usage | ||
|
||
Right after starting the program, the endpoints available are the following: | ||
|
||
- `GET http://localhost:4528/inject/first` | ||
- `GET http://localhost:4528/inject/second` | ||
- `GET http://localhost:4528/inject/third` | ||
|
||
On the program console, press `<enter>` one time will add this new endpoint: | ||
- `GET http://localhost:4528/inject/fourth` | ||
|
||
Press `<enter>` again to add the following endpoint: | ||
- `GET http://localhost:4528/inject/fifth` | ||
|
||
Press `<enter>` to remove the following endpoint: | ||
- `GET http://localhost:4528/inject/fourth` | ||
|
||
Then press `<enter>` to quit the application | ||
|
||
You can test the presence or absence of the specified endpoints between each step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.