Giter Site home page Giter Site logo

lerina / http Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thecoshman/http

0.0 1.0 0.0 689 KB

Host These Things Please - a basic http server for hosting a folder fast and simply

License: MIT License

Shell 0.42% JavaScript 4.83% Rust 91.15% HTML 3.20% NSIS 0.39%

http's Introduction

http Travis build status AppVeyor build status Licence Crates.io version

Host These Things Please - a basic HTTP server for hosting a folder fast and simply

Selected features

See the manpage for full list.

  • Symlinks followed by default (disableable via -s option)
  • Index generation for directories
  • Sane defaults (like hosted dir (.) and port (first free one from range 8000-9999))
  • Correct MIME type for served files
  • Handled request methods: OPTIONS, GET, PUT, DELETE, HEAD and TRACE ("writing" methods are off by default, enable via -w switch)
  • Proper handling of percent-encoded URLs (like асдф fdsa)
  • Good symlink handling compatible with Windows
  • Multitude of information in directory indices
  • Serving index files like index.{html,htm,shtml} from directories (disableable via -i switch)
  • Drag&Drop to upload files (with -w specified)
  • Smart encoding of generated and filesystem-originating responses (disableable via -e switch)
  • Full Range header support
  • Hosting with an (optional) optionally autogenerated TLS certificate
  • Arbitrarily nested username/password authentication
  • Per-request bandwidth cap
  • Per-extension-overridable MIME-types with reasonable guesses
  • WebDAV/RFC2518 support, tested with the Linux davfs2 helper, Windows network filesystem support (out-of-box), and the Total Commander WebDAV plugin
  • RFSAPI support (format spec) (explorable from commandline with D'Oh)

Installation

From Cargo

If you have cargo installed (you're a Rust developer) all you need to do is:

cargo install https

Which will install http and httplz (identical, disable one or another if they clash) in the folder where all other binaries go.

On Arch Linux

Available from the community repository as httplz:

pacman -S httplz

From an installer

If, however, you're not a Rust developer, but you have sh-like shell, you can use an installer (works on Windows and Linux):

curl -SsL https://cdn.rawgit.com/thecoshman/http/master/install.sh | sh
# or, if you like taking precautions
sh -c "$(curl -SsL https://cdn.rawgit.com/thecoshman/http/master/install.sh)"

You can change the installation directory by setting the PREFIX environment variable (default - /usr/bin):

PREFIX=$HOME/bin curl -SsL https://cdn.rawgit.com/thecoshman/http/master/install.sh | sh
# Windows:
set PREFIX=D:\Akces
curl -SsL https://cdn.rawgit.com/thecoshman/http/master/install.sh | sh

If you're on a Debian-based amd64 machine, you can also grab a .deb package from the latest release page.

If you're on Windows and prefer a more guided installation (or you don't have a shell), you can download the Windows installer from the latest release's page. (Note: you can add /D INSTALLDIR to installer command line to change the installation directory.)

Aims

The idea is to make a program that can compile down to a simple binary that can be used via Linux CLI to quickly take the current directory and serve it over HTTP. Everything should have sensible defaults such that you do not have to pass parameters like what port to use.

  • Sub directories would be automatically hosted.
  • Symlinks will not be followed by default (in my opinion, this is more likely to be a problem than an intended thing).
  • Root should not be required.
  • If an index file isn't provided, one will be generated (in memory, no touching the disk, why would you do that you dirty freak you), that will list the current files and folders (and then sub directories will have index files generated as required)
  • Changes made to files should be reflected instantly, as I don't see why anything would be cached... you request a file, a file will be looked for

It's not going to be a 'production ready' tool, it's a quick and dirty way of hosting a folder, so whilst I'll try to make it secure, it is not going to be a serious goal.

http's People

Contributors

nabijaczleweli avatar thecoshman avatar cyqsimon avatar adrianisuru avatar pheki avatar jim4067 avatar orhun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.