Skip to content

frou/gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

$ gateway -help

gateway is a basic dynamic webserver that delegates handling of HTTP requests
to executables on disk using the Common Gateway Interface (CGI).

For example, an executable with the basename qux is responsible for handling a
request for the /qux HTTP resource. An executable with the special basename _
is responsible for handling a request for the / HTTP resource (i.e. the
homepage).

An executable handles a request by writing HTTP headers (Status, Content-Type,
...) followed by some content (likely HTML) to standard output, and then
exiting. CGI information is conveyed to executables using environment variables
with standard names - see http://www.cgi101.com/book/ch3/text.html

Go's standard library does the heavy-lifting.

usage:
  gateway [flags] /path/to/executables/dir

flags:
  -copyenv
        child processes get a copy of the server's environment variables
  -port int
        tcp port number on which to listen for connections (default 80)
  -wildcard
        have _ perform double-duty and also handle any HTTP resource that isn't
        otherwise handled
  -withenv string
        child processes get exactly these environment variables, specified in
        the form k0=v0,k1=v1,...

About

Basic dynamic (CGI) webserver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages