https://github.com/b13rg/locallhost
A tool to display information about http requests
https://github.com/b13rg/locallhost
echo-server golang http
Last synced: 26 days ago
JSON representation
A tool to display information about http requests
- Host: GitHub
- URL: https://github.com/b13rg/locallhost
- Owner: B13rg
- License: mit
- Created: 2025-08-18T22:09:40.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-08-27T22:58:31.000Z (7 months ago)
- Last Synced: 2025-10-03T12:59:23.926Z (6 months ago)
- Topics: echo-server, golang, http
- Language: Go
- Homepage: http://6.resolv.to
- Size: 2.81 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# locallhost
A simple http server that echoes client http request information.
Also provides links to localhost (`127.0.0.1`, `[::1]`) for easy navigation to locally hosted projects.
Table of Contents
- [locallhost](#locallhost)
- [Key Features](#key-features)
- [Technical Overview](#technical-overview)
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Configuration](#configuration)
- [Deployment](#deployment)
- [Documentation and Additional Resources](#documentation-and-additional-resources)
- [Links](#links)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
## Key Features
* Show request IP address and port
* `/ip` endpoint provides raw request IP address
* Show entire HTTP request header
* `/json` endpoint provides request info formatted as JSON
* ipv4+ipv6 localhost links
* Quick links for port 80
* Customizable port number
* Webpage < `7kB`, Binary < `10MB`, Docker image < `13MB`

## Technical Overview
Uses Golang's `net/http` and `html/template` packages to display request info.
## Installation
```
go install -v github.com/B13rg/locallhost@main
```
## Getting Started
### Configuration
```sh
❯ ./locallhost -h ─╯
Start a server on a configured port that returns info about http requests.
Usage:
locallhost [flags]
locallhost [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
version Get version
Flags:
--color enable colorized output (default true)
--debug log additional information about what the tool is doing. Overrides --loglevel
-h, --help help for locallhost
-L, --loglevel string set zerolog log level (default "info")
-p, --port int Set http port for server to listen on (default 8080)
--profiledir string directory to write pprof profile data to
Use "locallhost [command] --help" for more information about a command.
```
### Deployment
#### Natively
```
go build ./locallhost
./locallhost
```
#### Docker
```
docker-compose -f ./docker/compose.yml build
docker-compose -f ./docker/compose.yml up -d
```
## Documentation and Additional Resources
See [./docs](docs/) folder.
Most if not all of the documentation is generated from the golang code.
### Links
* Inspiration:
* https://locallhost.com
## Development
Uses Golang `1.24.2`.
### Contributing
Open an issue or PR.
## License
[MIT](LICENSE)