No description
| .gitignore | ||
| AUTHORS | ||
| go.mod | ||
| INSTALL | ||
| LICENSE | ||
| README | ||
| svhop-parsehost.go | ||
| texts.go | ||
| virthosts | ||
# svhop: Simple virtual hosts for oneliner protocols Depending on the host, pass on a request to one of multiple server programs designed to run under a super-server (i.e. the servers read from the standard input and write to the standard output). This project contains one binary, the "svhop-parsehost" program. It exports the environment variables REQUEST (containing the full request including CRLF) and HOSTNAME, then "chainloads" into its commandline, i.e. it execs into a program named by its first argument, giving the rest of its arguments to that program. The "chainloading" nature of this program is designed to fit into the execline script language, which is based on chainloading. The execline script can compare the value of HOSTNAME to various names the server may be known under, and exec into a program based on those comparisons. The value of REQUEST needs to be fed into the server program. An example execline script, "virthosts", is provided that utilises s6-tlsserver as the super-server. Works with "oneliner" protocols, by which I mean: the request format is a single line which starts with the url and is terminated with LF or CRLF. The primary target protocol is gemini, but it could be applied to other protocols, including if the request contains one or more space-separated arguments after the URL. As is, in case of an error, svhop gives a gemini response in English with a gemini failure status code. To change this, it is possible compile svhop-parsehost with a different texts.go file (the execline script must also be altered to mirror this change). Currently, there is only the one texts.go file