Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.01 KB

Readme.md

File metadata and controls

67 lines (48 loc) · 2.01 KB

Building a Web Server

Develop the skills needed to build a web server from scratch, starting with a simple program and progressing to handling multiple HTTP GET and POST requests. The server is written in assembly using the GNU Assembler using Intel Syntax.

Code

Notes

Level 9

The GET request is in the form,

GET /tmp/tmplfy_on1j HTTP/1.1\r\nHost: localhost\r\nUser-Agent: python-requests/2.31.0\r\nAccept-Encoding: gzip, deflate, zstd\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n
curl http://localhost/etc/issue

Normalized,

GET /tmp/tmplfy_on1j HTTP/1.1
Host: localhost
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, zstd
Accept: */*
Connection: keep-alive

Level 10

The POST request is in the form

POST /tmp/tmp_lujmq8s HTTP/1.1\r\nHost: localhost\r\nUser-Agent: python-requests/2.31.0\r\nAccept-Encoding: gzip, deflate, zstd\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Length: 106\r\n\r\nluxCpwzQX11ZXl4ASUNdK8gPozVzNKZTnVVdeynQP6YiGHp1IZOIt5PggTzf8VqqDMc3xARQ19L9yCiasFYyQJykvOnczTiqVaMfpz3JHl
curl -d "luxCpwzQX11ZXl4ASUNdK8gPozVzNKZTnVVdeynQP6YiGHp1IZOIt5PggTzf8VqqDMc3xARQ19L9yCiasFYyQJykvOnczTiqVaMfpz3JHl" -X POST http://localhost/tmp/mypost

Normalized,

POST /tmp/tmp_lujmq8s HTTP/1.1
Host: localhost
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, zstd
Accept: */*
Connection: keep-alive
Content-Length: 106

luxCpwzQX11ZXl4ASUNdK8gPozVzNKZTnVVdeynQP6YiGHp1IZOIt5PggTzf8VqqDMc3xARQ19L9yCiasFYyQJykvOnczTiqVaMfpz3JHl

Useful links