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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址