Skip to content

Latest commit

 

History

102 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kghttp

A small Go HTTP layer built from scratch.

The goal is not to replace the standard library or popular tools like net/http. It is to learn how HTTP pieces fit together by implementing request parsing, response writing, transfer handling, and client/server behavior directly.

Packages

Package Status Description
kghttp Available HTTP/1.1 client and server on raw TCP — request/response parsing, transfer readers, chunked bodies, trailers
kgurl Available URL parsing wrapper around Go's net/url, intended to grow into a local implementation
kgbuf Available Minimal buffered I/O utilities for this stack
kgroute Coming Soon Minimal HTTP router (Chi-like API, fewer features)

See each package's README.md for API details and usage.

Examples

Runnable examples live under examples/. The current example server is documented in kghttp/README.md.

Requirements

  • Go 1.23.5 or newer

Getting started

Clone the repo:

git clone https://github.com/kgxlabs/kghttp.git
cd kghttp

Import a package from the module root:

import "github.com/kgxlabs/kghttp/kghttp"
import "github.com/kgxlabs/kghttp/kgurl"
import "github.com/kgxlabs/kghttp/kgbuf"

Run tests for everything:

go test ./...

Run tests for a single package:

go test ./kghttp/...
go test ./kgbuf/...

Repository layout

.
├── go.mod
├── kgbuf/               # Minimal buffered I/O utilities (available)
│   └── README.md
├── kghttp/              # HTTP/1.1 client/server (available)
│   └── README.md
├── kgurl/               # URL parser wrapper (available)
│   └── README.md
└── examples/            # Runnable demos
    └── httpserver/

Philosophy

  • Small surface area — only what is needed for the next layer
  • Readable over clever — code you can step through in an afternoon
  • Composable — each package should stand alone and plug into the others
  • Built to learn — correctness and clarity before feature parity with production libraries

License

No license file is included yet.

About

Low-level HTTP/1.1 server implementation with custom routing and buffered I/O, part of the KGX infrastructure ecosystem.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages