Cloudxtreme / shellscripthttpd

HTTPD written entirely in shell (works with Busybox)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shellscripthttpd

HTTPD written entirely in shell (works with Busybox)

Start with ACME micro_inetd or any other inetd.

##Features:

  • works with inetd
  • supports HTTP/1.0
  • supports GET, POST and HEAD methods
  • follows POST/Redirect/GET pattern
  • single file
  • exports request headers according to CGI standard: HTTP_

built-in functions

  • add_route
  • require_POST
  • redirect
  • read_post_var
  • _e

create own actions

Add following:

add_route '^/hello/$' hello

action_hello(){
    X=`wc -l < /etc/passwd`
}

view_hello(){
    echo "<html>"
    echo "<p>lines in passwd: $X</p>"
    cat file.txt | _e
    echo "</html>"
}

start the HTTPD

$ micro-inetd 8080 /path/to/httpd.sh

About

HTTPD written entirely in shell (works with Busybox)

License:The Unlicense


Languages

Language:Shell 100.0%