A lightweight, custom HTTP server implementation written in Go. This project demonstrates the fundamentals of HTTP server implementation from scratch, handling raw HTTP requests and responses.
- Custom HTTP server implementation
- Raw HTTP request handling
- HTTP response generation
- Connection management
- Configurable host and port
.
├── main.go # Application entry point
├── server/ # Server implementation
│ ├── server.go # Main server logic
│ ├── response.go # HTTP response handling
│ └── connection.go # Connection management
├── model/ # Data models
└── utils/ # Utility functions
- Go 1.x or higher
- Clone the repository:
git clone https://github.com/R11manish/raw-http-server.git
cd raw-http-server
- Install dependencies:
go mod download
Run the server:
go run main.go
The server will start on 127.0.0.1:8080
by default.
The server can be configured by modifying the following parameters in main.go
:
- Host: Default is "127.0.0.1"
- Port: Default is 8080
The project is structured into several key components:
server.go
: Contains the main HTTP server implementationresponse.go
: Handles HTTP response generation and formattingconnection.go
: Manages client connections and request processing