locallhost

command module
v0.0.0-...-3b1aa48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 1 Imported by: 0

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

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

Screenshot of the web application

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
❯ ./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 folder. Most if not all of the documentation is generated from the golang code.

Development

Uses Golang 1.24.2.

Contributing

Open an issue or PR.

License

MIT

Documentation

Overview

Purpose of package

Directories

Path Synopsis
Defines the cli-interface commands available to the user.
Defines the cli-interface commands available to the user.
Generates docs for golang code and commands.
Generates docs for golang code and commands.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL