HTTP-Server
Builds off a simple HTTP server implementation in C. The ultimate goal is to convert the HTTP server into a robust HTTPS server, keeping security in mind.
Problem Solving
Learning Objectives
- Understand the differences between HTTP and HTTPS servers. Transition the base HTTP server into a HTTPS server
- Use pentesting/vulnerabilitiy tools to create a robust server
- Find ways to organize my code that reduces complexity
- Connect with OWASP Top Ten
- Document misconceptions and roadblocks. This ties with
*DISCLAIMER: This is a developing project so take the information with a grain of salt. The goal is to promote the learning experience rather than getting everything right at the start.
Helpful Commands
General
Git
- git status
- git add --all
- git commit -m "[comment]"
- git push
Curl
- curl -v localhost:8080/home.html
gdb
Server Structure
This is the basic structure of my HTTP server. The server is run on a localhost using the port 8080 and curl is used to make requests to the server in order to get items in that server.
Future Items
- SQL database (store random data)
- Implement TLS/SSL protocol
Documentation
All Methods
- const char get_file_extension(const char filename)
- const char get_mime_type(const char file_ext)
- bool case_insensitive_compare(const char s1, const char s2)
- char get_file_case_insensitive(const char file_name)
- char url_decode(const char src)
- void build_http_response(const char file_name, const char file_ext, char response, size_t response_len)
- void handle_client(void arg)
- int main(int argc, char *argv[])
Sorted Methods
I have created a diagram to visualize what methods call others. This helps me see and understand the components of a client/server interaction.
Implementation
It is exciting that I can request items from my server through a web browser by using "http://localhost:[port number]/[item]"
Roadblocks
Helpful Resources