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
Everything you need, nothing you don't.
11,000+ requests/sec with keep-alive. Zero-copy parsing, buffer pooling.
Built from raw TCP sockets. No external HTTP libraries required.
TLS/HTTPS support, path traversal protection, panic recovery.
Register routes, handle requests. That's it. No magic.
Route patterns like /users/:id with automatic extraction.
Serve HTML, CSS, JS from pages/ with MIME detection.
Benchmarked on 8-core system with keep-alive enabled.
| 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 |
Up and running in 30 seconds.
go get github.com/codetesla51/raw-http@v1.0.0
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)
}
}
go run main.go
# Server listening on http://localhost:8080
curl http://localhost:8080/ping # pong
curl http://localhost:8080/users/42 # 42
Projects powered by raw-http in production.