Skip to content

huandu/handyhttpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

handyhttpd – A Handy HTTP Server

handyhttpd, as its name implies, is a handy http server to enable public http access on any folder with a simple command. It’s designed for simplicity.

Tutorial

Installation

handyhttpd is written in go. Install latest go before start.

Use following command to get and build it with go.

go get github.com/huandu/handyhttpd
go install github.com/huandu/handyhttpd

handyhttpd will be built and installed to $GOPATH/bin/handyhttpd.

Basic Usage

Run it in any dir to get public http access.

[user@server /your/dir/foo]$ handyhttpd

handyhttpd listens port 9696 by default. This dir can be accessed by url http://localhost:9696/foo.

If you need to add more dir to handyhttpd, just go to that dir and run exactly the same command.

[user@server /your/dir/foo]$ cd /your/dir/bar
[user@server /your/dir/bar]$ handyhttpd

Maybe the dir name “bar” doesn’t sound cool, use --alias option to rename it.

[user@server /your/dir/bar]$ handyhttpd --alias=soundy_bar

Once you don’t need to provide http service any more, type handyhttpd --quit.

If port 9696 is not your favorate, you can specify a port by --port option on handyhttpd first start. Just notice that handyhttpd cannot change port after it’s up. Restart it to change port.

Use --help to explore all handyhttpd options and have fun.

Comparisions With python -m SimpleHTTPServer

In short, handyhttpd is a bit stronger and easier than python -m SimpleHTTPServer.

handyhttpd implements all python -m SimpleHTTPServer features.

In addition, it can

  • serve more than one dir on a single port.
  • run only one server instance at once – much easy to manage. You can start handyhttpd over one ssh connection and modify/quit it over another. There is no need for you to use ps and kill with handyhttpd.

About

A handy http server to enable public http access on any folder within a few seconds.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages