Skip to content

Rhodri-Davies/shellscripthttpd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%