This repository contains a simple HTTP server built using Python's socket module. The server is designed to listen for HTTP requests, process GET requests, and return responses based on the requested path.
- Simple HTTP GET Handling: The server handles basic
GETrequests and serves specific files based on the requested path. - Content Delivery:
- Serves
index.htmlwhen the root path/is requested. - Serves
randm.jsonwhen the/randmpath is requested.
- Serves
- The server binds to
0.0.0.0on port8080and starts listening for incoming connections. - For each client connection:
- Receives and decodes the HTTP request.
- Checks if the HTTP method is
GET. - Depending on the request path:
- Serves
index.htmlfor/. - Serves
randm.jsonfor/randm.
- Serves
- Constructs HTTP headers and sends the response back to the client.
- Closes the client connection after responding.
- For unsupported HTTP methods, returns a
405 METHOD NOT ALLOWEDresponse.