Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.61 KB

README.md

File metadata and controls

36 lines (23 loc) · 1.61 KB

webserv

an HTTP server in c++

At the most basic level, whenever a browser needs a file that is hosted on a web server, the browser requests the file via HTTP. When the request reaches the correct (hardware) web server, the (software) HTTP server accepts the request, finds the requested document, and sends it back to the browser, also through HTTP.

HTTP server usually use TCP for communications.

TCP socket programming

Socket : mechanism to give programs access to the network

  • create a socket with socket()
  • identify the socket with bind()
  • wait for a connection with listen() and accept()
  • send and receive messages with read() and write() (or send() and recv())
  • close the socket with close()

Resources

Guide to Network Programming

Simple server with C++

C++ Web Programming

How to build a simple HTTP server

Understanding Nginx Server and Location Block Selection Algorithms

nginx documentation

Multiplexage

HTTP MDN