How can i make web server from scratch

This page summarizes the projects mentioned and recommended in the original post on /r/webdev

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ZAP

    The ZAP core project

  • I would start by installing Burp Suite or OWASP Zap and seeing what the actual messages look like

  • HTTP_Server

    Multithread web-server. Supported requests: GET, POST, PUT, DELETE. (by arthurzhukovski)

  • Oh, I don't get why your post is getting donvoted. I've had such an assignment 7 years ago at the university nad it was pretty fun assignment. Here's a github repo of a C# project: https://github.com/JonesTwink/HTTP_Server I was a student back then so the code is pretty terrible, but I think youll get the concept First of all you have to be aware of the existance of the OSI network model which consists of 7 layers. For this project you need a basic knowleedge of the 4-th layer which is Transport layer. The protocol you'll be using is TCP protocol. Choose any programming language you like that can listen for incoming TCP connections. You can do it with Node's net package. Let's implement serving static html. Start listening to any desired port. All the test requests you'll be sending to your web server via Postman or any toher client have to be sent to the exact same port. When your TCP server recieves new data it'll either fire an event or use an iterator or else, it depends on the implementation of the TCP library/package. Inside that construct you'll be able to access data that has been sand to your server. Read these packets as strings. These strings are HTTP headers except the first one which is actually the request line. Split the strings by line breakes. From the request line extract http method and path to the requested resource. For instance, if it's a GET method and /example.html resource, then you should read the contents of the exmaple.html file and send it as a TCP response. But before sending the actual contents of the file you should prepend status, content type and content length header to your response string. If everything is done correctly you should get this static html as a response to your Postman request.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts