Skip to content

Liam-Wirth/asm-webserver

Repository files navigation

Web Server Implementation Checklist

1. Core Network Setup

  • Create socket
  • Bind to port
  • Listen for connections
  • Accept connections
  • handle socket cleanup
  • signal handling for graceful shutdown

Basic Request Handling

  • Parse HTTP methods (GET/POST)
  • Extract request path
  • Basic request logging
  • Complete POST handling
  • Parse query parameters
  • Parse request headers

Response Generation

  • Shift to sending inlined html (in the asm) to prevent issue of missing html files
  • Send basic HTTP status codes:
    • 200 OK
    • 404 Not Found
    • 403 Forbidden
    • 500 Server Error
  • Include some headers:
    • Content-Type (basic)
    • Content-Length
    • Connection
  • Send response body

File Operations

  • Read static files
  • Basic directory structure (/www)
  • Default file (index.html)
  • Handle file not found
  • Complete MIME type detection
  • Basic directory security

Essential Security (Only handling GET requests rn)

  • Validate request paths
  • Prevent directory traversal
  • Character validation
  • Path whitelist
  • Basic input validation

Error Handling and Logging

  • Structured logging (INFO/ERROR/DEBUG)
  • Handle socket errors
  • Handle file system errors
  • Process forking errors
  • Connection handling errors

Process Management

  • Fork for each connection
  • Child process cleanup
  • Parent process continuation
  • Signal handling

Maybe Later:

  • Multiple concurrent connections
  • Keep-alive connections
  • Request/response compression
  • Virtual hosting
  • HTTPS support

Links and stuff

https://www.reddit.com/r/C_Programming/comments/kbfa6t/building_a_http_server_in_c/ https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500

About

I just thought this would be funny to be honest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published