项目作者: ethanpil

项目描述 :
A tiny, simple static file web server.
高级语言: HTML
项目地址: git://github.com/ethanpil/sheret.git
创建时间: 2017-05-26T18:17:14Z
项目社区:https://github.com/ethanpil/sheret

开源协议:GNU General Public License v3.0

下载


THIS PROJECT IS ABANDONED.

I use and recommend https://static-web-server.net/


sheret-logo

Sheret

A tiny, simple static web server written in Go.

GPL Licence

Table of Contents

Install

Windows binaries are available from the Sheret Releases page on GitHub. Download and extract the binary to anywhere on your filesystem. There are no dependencies.

Usage

2017-05-26_144823

  1. Usage: sheret [options]
  2. Parameters:
  3. -d string
  4. directory to serve from (default ".")
  5. -f string
  6. log to disk path [./sheret.log]
  7. -p string
  8. port to serve on (default "8100")
  9. -q suppress all logging
  10. -b do not open default browser
  11. -h show usage help

After downloading, you can start Sheret simply with sheret from the command line. By default, Sheret will begin serving from the directory it is located, on HTTP port 8100. Sheret will log all activity to the console. To terminate Sheret, simply type CTRL+C in the console window.

The console window will log all requests, and pretty print both URL Parameters as well as POST request variables for easier debugging.

  1. 2020/04/19 22:06:18 Sheret v1.2 serving . on HTTP port: 8100
  2. 2020/04/19 22:06:18 -- Press CTRL-C to terminate --
  3. 2020/04/19 22:06:19 [::1]:43578 GET /
  4. 2020/04/19 22:06:46 [::1]:43578 GET /?urlvar1=abc&urlvar2=def
  5. 2020/04/19 22:06:46 URL: urlvar1 = abc
  6. 2020/04/19 22:06:46 URL: urlvar2 = def
  7. 2020/04/19 22:06:46 ---- End Data. 2 Values Received ----
  8. 2020/04/19 22:07:05 [::1]:43578 POST /?urlvar1=abc&urlvar2=def
  9. 2020/04/19 22:07:05 URL: urlvar1 = abc
  10. 2020/04/19 22:07:05 URL: urlvar2 = def
  11. 2020/04/19 22:07:05 POST: selector = Option 02
  12. 2020/04/19 22:07:05 POST: texter = 789
  13. 2020/04/19 22:07:05 POST: radio2 = on
  14. 2020/04/19 22:07:05 POST: checker = on
  15. 2020/04/19 22:07:05 POST: inputer = 123
  16. 2020/04/19 22:07:05 ---- End Data. 7 Values Received ----

The -f option will enable logging to disk. All console output from Sheret will also be saved in sheret.log next to the executable.

Contribute

PRs accepted. Submit any suggestions or corrections via a GitHub pull request. Support via GitHub issues is limited.

Security

This is a simple tool meant for developers to test local code. It is 100% based on Golangs included HTTP library. No security related code or testing has been added by the author. This tool is not meant for production use, or even any type of server which connects directly to a public network. No guarantee is provided or implied.

Changelog

*v1.21 - May 8, 2020

  1. New: Add flag to disable open system browser on launch

*v1.2 - April 19, 2020

  1. New: Remove folder creation in zipped release by packaging script
  2. New: Reduce binary size (2mb!) by stripping debug information during build
  3. New: Log both URL Params and POST Vars. Simplify output
  4. New: Open system browser to root on launch
  5. Internal: Fix some whitespacing in code (Yak shave!)
  6. Internal: Add notification and pause to release packaging script

*v1.1 - April 14, 2020

  1. Remove hardcoded logfile path. -f parameter works now
  2. Better error handling and messages when logpath fails
  3. Improve quiet mode for complete quiet
  4. Release without UPX packing to prevent false positive with AV tools
  5. Improve default HTML page
  6. New build/release scripts

*v1.0 - May 26, 2017

  1. Initial Release

WIP

Perhaps the next version… perhaps never. :) PR requests will help!

  • Make quiet mode not mutually exclusive of logfile/console
  • Commandline flag to disable browser open
  • Commandline flag to disable data logging (but still log requests)
  • Simple CGI passthrough (very unlikely)

Credits & Acknowledgments

  • The Sheret logo icon is provided by FreePik
  • FYI: שרת Sheret is the Hebrew word for Server :)

License

GPL v3 © Ethan Piliavin