v1.0.0 Released

HTTP Server,
Raw & Fast

A lightweight HTTP/1.1 server built from raw TCP sockets in Go for small apps. Bare metal. Very little abstraction. Just pure performance.

go get github.com/codetesla51/raw-http@v1.0.0

Built for Simplicity

Everything you need, nothing you don't.

Fast

11,000+ requests/sec with keep-alive. Zero-copy parsing, buffer pooling.

Zero Dependencies

Built from raw TCP sockets. No external HTTP libraries required.

Secure

TLS/HTTPS support, path traversal protection, panic recovery.

Simple API

Register routes, handle requests. That's it. No magic.

Path Parameters

Route patterns like /users/:id with automatic extraction.

Static Files

Serve HTML, CSS, JS from pages/ with MIME detection.

Performance

Benchmarked on 8-core system with keep-alive enabled.

11,042
requests/sec
500 concurrent
17.9
ms latency
100 concurrent
0
dependencies
raw TCP sockets
Scenario Concurrency Requests/sec Latency
GET /ping 100 5,601 17.9ms
GET /ping 500 11,042 45.3ms
POST with body 100 5,773 17.3ms

Quick Start

Up and running in 30 seconds.

1

Install

go get github.com/codetesla51/raw-http@v1.0.0
2

Write your server

package main

import (
    "log"
    "github.com/codetesla51/raw-http/server"
)

func main() {
    srv := server.NewServer(":8080")

    srv.Register("GET", "/ping", func(req *server.Request) ([]byte, string) {
        return server.CreateResponseBytes("200", "text/plain", "OK", []byte("pong"))
    })

    srv.Register("GET", "/users/:id", func(req *server.Request) ([]byte, string) {
        userID := req.PathParams["id"]
        return server.CreateResponseBytes("200", "text/plain", "OK", []byte(userID))
    })

    // Graceful shutdown on Ctrl+C
    if err := srv.ListenAndServe(); err != nil {
        log.Fatal(err)
    }
}
3

Run

go run main.go
# Server listening on http://localhost:8080

curl http://localhost:8080/ping       # pong
curl http://localhost:8080/users/42   # 42

Built with raw-http

Projects powered by raw-http in production.

Ready to build?

Start building your next project with raw-http.