httpserve

command module
v0.0.0-...-50074ae Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: MIT Imports: 20 Imported by: 0

README

HTTPserve

GitHub go.mod Go version License contributions welcome

Small tool to serve files over HTTP which provides more verbose log output.

Installation

$ go install -v 'github.com/rykkard/httpserve@latest'

Usage

$ httpserve -h
Small tool to serve files/directories over HTTP with more verbosity.

Usage:
   httpserve [OPTIONS] <filenames|directories>

Options:
   -p, --port <port>           port to serve on (default: 8000)
   -b, --bind <interface>      interface to bind (default: 0.0.0.0)
   --cors                      enable cors
   --list                      enable listing on root paths (/)
   --auth <user:pass>          enable basic authentication
   -v, --verbose               enable more verbose (headers)
   -s, --silent                enable silent mode
   -h, --help                  show help

Examples

  • Just listen mode
$ httpserve
[*] Serving HTTP on 0.0.0.0 port 8000
127.0.0.1 - - [13/Aug/2020:17:45:34 -0500] "GET / HTTP/1.1" 200 10
127.0.0.1 - - [13/Aug/2020:17:46:24 -0500] "POST / HTTP/1.1" 200 10
Hello world!

127.0.0.1 - - [13/Aug/2020:17:46:47 -0500] "POST / HTTP/1.1" 200 10
+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+
127.0.0.1 - - [13/Aug/2020:17:49:36 -0500] "POST / HTTP/1.1" 200 10
GG
<..>
  • Serving files
$ httpserve LICENSE.md README.md
[*] Stagging resources
.
└── LICENSE.md
└── README.md
[*] Serving HTTP on 0.0.0.0 port 8000
<..>
  • Serving directory files with any other file
$ httpserve /dev/shm/ README.md
[*] Stagging resources
/dev/shm
└── /dev/shm/somefile
.
└── README.md
[*] Serving HTTP on 0.0.0.0 port 8000
<..>

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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