├── http_web_server ├── test │ ├── php │ │ ├── phptest_1.php │ │ └── phptest_2.php │ ├── perl │ │ ├── hello.pl │ │ ├── print_env.cgi │ │ ├── form.pl │ │ └── perl_test_2.html │ ├── html │ │ ├── demo_1.html │ │ ├── demo_2.html │ │ └── form_validation.html │ ├── python │ │ ├── hello.py │ │ ├── py_demo_2.html │ │ ├── checkbox.html │ │ ├── hello_get.py │ │ └── checkbox.cgi │ └── test.html ├── images │ ├── http_server_test.png │ └── http_server_main_page.png ├── HttpAcceptor.hpp ├── HttpServer.hpp ├── Makefile ├── main.cpp ├── HttpServer.cpp ├── HttpAcceptor.cpp ├── README.md ├── HttpService.hpp └── HttpService.cpp ├── https_web_server ├── test │ ├── php │ │ ├── phptest_1.php │ │ └── phptest_2.php │ ├── perl │ │ ├── hello.pl │ │ ├── print_env.cgi │ │ ├── form.pl │ │ └── perl_test_2.html │ ├── html │ │ ├── demo_1.html │ │ ├── demo_2.html │ │ └── form_validation.html │ ├── python │ │ ├── hello.py │ │ ├── py_demo_2.html │ │ ├── checkbox.html │ │ ├── hello_get.py │ │ └── checkbox.cgi │ └── test.html ├── images │ ├── allow_https_request.png │ └── https_web_server_main_page.png ├── gen_openssl_key.sh ├── HttpsServer.hpp ├── Makefile ├── HttpsAcceptor.hpp ├── HttpsServer.cpp ├── main.cpp ├── HttpsAcceptor.cpp ├── README.md ├── HttpsService.hpp └── HttpsService.cpp └── README.md /http_web_server/test/php/phptest_1.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /https_web_server/test/php/phptest_1.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /http_web_server/test/perl/hello.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | 4 | print 'Hello world'; 5 | -------------------------------------------------------------------------------- /https_web_server/test/perl/hello.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | 4 | print 'Hello world'; 5 | -------------------------------------------------------------------------------- /http_web_server/images/http_server_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pritamzope/http_web_server/HEAD/http_web_server/images/http_server_test.png -------------------------------------------------------------------------------- /http_web_server/images/http_server_main_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pritamzope/http_web_server/HEAD/http_web_server/images/http_server_main_page.png -------------------------------------------------------------------------------- /https_web_server/images/allow_https_request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pritamzope/http_web_server/HEAD/https_web_server/images/allow_https_request.png -------------------------------------------------------------------------------- /https_web_server/images/https_web_server_main_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pritamzope/http_web_server/HEAD/https_web_server/images/https_web_server_main_page.png -------------------------------------------------------------------------------- /https_web_server/gen_openssl_key.sh: -------------------------------------------------------------------------------- 1 | # generate SSL certificate and private key 2 | openssl req -newkey rsa:2048 -nodes -keyout HttpsWebServer.key -x509 -days 365 -out HttpsWebServer.cert 3 | -------------------------------------------------------------------------------- /http_web_server/test/html/demo_1.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 |
25 |
26 |
27 | ## HTTPS Web Server Main Page:-
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/https_web_server/HttpsServer.cpp:
--------------------------------------------------------------------------------
1 | #include Tell us about yourself.
8 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /https_web_server/test/perl/perl_test_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |Tell us about yourself.
8 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /http_web_server/HttpAcceptor.cpp: -------------------------------------------------------------------------------- 1 | #include| demo_1.html | 36 |demo_2.html | 37 |form_validation.html | 38 |
| Python Demo 2 | 58 |CheckBox Demo | 59 |
| Perl Form Test | 71 |
| demo_1.html | 36 |demo_2.html | 37 |form_validation.html | 38 |
| Python Demo 2 | 58 |CheckBox Demo | 59 |
| Perl Form Test | 71 |
48 |
49 | That means server is started successfully and ready to serve clients.
50 | Many clients are given in **test** directory such as static HTML pages,PHP, CGI, Python and Perl scripts.
51 |
52 | Navigate your browser URL to **127.0.0.1:1234/test.html**, it will show following page for testing each web scripts.
56 |
57 |
58 |
--------------------------------------------------------------------------------
/https_web_server/README.md:
--------------------------------------------------------------------------------
1 |
2 | # HTTPS Web Server
3 |
4 | --------------------------------------------------------------------------------
5 |
6 | # What Is It?
7 |
8 | An synchronous tiny HTTPS web server that supports HTTP web requests over Secure Socket Layer(SSL) as well as
9 | PHP, CGI, Python, Perl etc. scripts execution on server sides.
10 |
11 | # Compilation
12 |
13 | ### Dependency
14 |
15 | ##### GCC with C++11 compiler(g++)
16 | ##### Boost C++ Library
17 | ##### OpenSSL library
18 |
19 | ### Step 1: Getting the Source Code
20 |
21 | You can download source by command:
22 |
23 | $ git clone https://github.com/pritamzope/http_web_server.git
24 | $ cd http_web_server
25 |
26 | or you can get source via other ways you prefer at
88 |
89 | Some testing examples are given in **test** directory.
96 |
97 | That means server is started successfully and ready to serve clients.
98 | Many clients are given in **test** directory such as static HTML pages,PHP, CGI, Python and Perl scripts.
99 |
100 | Navigate your browser URL to **127.0.0.1:1234/test.html**, it will show following page for testing each web scripts.\
93 | This is the default welcome page used to test the correct operation of the HTTP Web Server.\
94 |
If you can read this page, it means that the HTTP Web server at this site is working properly.\
95 |
You should replace this file (located at\
96 | the provided path when server is started /index.html)\
97 | before continuing to operate your HTTP server.\
98 |
Request the static HTML page with Server IP and port 1234.\
99 |
Request the PHP script and get it's the interpreted contents.\
100 |
\
95 | This is the default welcome page used to test the correct operation of the HTTPS Web Server.\
96 |
If you can read this page, it means that the HTTPS Web server at this site is working properly.\
97 |
You should replace this file (located at\
98 | the provided path when server is started /index.html)\
99 | before continuing to operate your HTTPS server.\
100 |
Request the static HTML page with Server IP and port 1234.\
101 |
Request the PHP script and get it's the interpreted contents.\
102 |