Skip to content

Very simple http server written in Go for local testing purposes

License

Notifications You must be signed in to change notification settings

shoenseiwaso/kantand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kantand

Very simple http server written in Go for local testing purposes

Overview

This is intended for developers who are testing a static website on their local systems (localhost, 127.0.0.1, ::1, etc.). By default it will bind to port 8000 on all available local IP addresses and serve the local directory recursively. This is convenient for developers who may want to access the website from another system, but is a glaring security hole if you don't want others to be able to access it.

The name kantand was chosen to be easy enough to type, and because in Japanese it means "easy daemon" (かんたんd).

Usage

To install:

$ go get github.com/shoenseiwaso/kantand

To run, assuming $GOPATH/bin is in your $PATH:

$ kantand
Serving directory '.' via HTTP on ':8000'.

To quit, press CTRL+C.

A safer option would be to bind only to localhost:

$ kantand -host localhost
Serving directory '.' via HTTP on 'localhost:8000'.

With TLS/SSL using Let's Encrypt (requires an internet-visible hostname):

$ kantand -host test.example.com -sslenable -sslletsencrypt

Optional parameters:

$ kantand -h
Usage of kantand:
  -host string
    	Hostname or IP to bind to (empty string for all IPs on this host)
  -p uint
    	Port to bind to (default 8000)
  -redirecthttp
    	Redirect HTTP request to HTTPS (default true)
  -sslcert string
    	TLS/SSL Certificate file
  -sslenable
    	Enable TLS/SSL (HTTPS)
  -sslkey string
    	TLS/SSL Key file
  -sslletsencrypt
    	Use Let's Encrypt for TLS/SSL certificate issuance and renewal
  -sslletsencryptcerts string
    	Let's Encrypt certificate cache directory (default "certs")
  -sslport uint
    	TLS/SSL port to listen on (default 8043)
  -www string
    	Directory to serve (default ".")

Licence

MIT

Author

Jeff Wentworth, co-founder of Curvegrid, a blockchain tooling company.

About

Very simple http server written in Go for local testing purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages