BuzingaServ is a custom web server application implemented in C++ that's designed to understand and process HTTP requests and responses.
BuzingaServ is capable of recognizing and processing Universal Resource Locators (URLs), ensuring accurate request routing.
The server handles plain text messages that conform to the Hypertext Transfer Protocol (HTTP) standards.
All messages are transmitted through a transport layer. BuzingaServ makes use of the Transmission Control Protocol (TCP), ensuring reliable message delivery.
Both HTTP and TCP are part of the internet protocol suite. It's worth noting that while our server is custom-built, these protocols' foundational support is provided by the operating system.
A language for communicating between two computers. It specifies how to transfer documents that are interconnected by hyperlinks. A message is constructed as a request or a response.
Transmission Control Protocol Used to establish host-to-host data transfer channels. It maintains communications between application processes between hosts (client and server), and they use port numbers to track sessions.
A conceptual model to specify how data should be packetized,addressed, transmitted routed and received. It made up of 4 abstraction layers: application, transport, internet and link layers. An application like a web browser needs to receive data over the internet it communicates with the Trancport layer of the CP/IP stack using a specific port number. HTTP usually uses port 80.
- A request line,
- Headers,
- Empty line,
- optional message body.
- Status line,
- Headers,
- Empty line,
- optional message body.
When a request is made by the application layer, the message passes through the layerson one side, and back up through layer on the other side. Logically each layer talks to the corresponding layer on the other side.
SOCKET -> BIND -> LISTEN -> ACCEPT -> READ/WRITE
We need to implement a ‘socket’ on which we can ‘listen’ for incoming connections, Then we need to ‘bind’ the socket to a local address, and port. Then put the socket in a ‘listen’ state. After that we’re able to ‘accept’ incoming connections, for each accepted connection a new socket will be created, and we will be able to read and write to this socket. The following diagram gives a bit of an overview of what we need to implement.
socket() creates an endpoint for communication and returns a descriptor.
- 42 Evaluation Sheet
- HTTP Server: Everything you need to know to Build a simple HTTP Server (Medium Premium)
- Making a simple HTTP webserver in C
- Thread pools
- Linux Programming Interface: Chapter 56-61
- RFC: 9112 (HTTP/1.1) (could be obsolete)
'WORD' |
Configfile | BLOCK ; BLOCK | BLOCK identifier '{' Body '}' | identifier '{' Body '}' ; Body | global | server location_BLOCK ; identifier | 'server' | 'global' ; global | Setting ; server | Setting ; location_BLOCK | location_BLOCK 'location' path '{' Setting '}' | 'location' path '{' Setting '}' ; Setting | Setting Option ';' | Option ';' ; Option | Key Value ; Key | WORD ; Value | Value WORD | WORD ; path | WORD ;