No description
Find a file
2023-08-17 12:57:28 +00:00
.gitignore initial commit - not yet tested at all 2023-08-15 20:37:35 +00:00
AUTHORS initial commit - not yet tested at all 2023-08-15 20:37:35 +00:00
go.mod initial commit - not yet tested at all 2023-08-15 20:37:35 +00:00
INSTALL add to documentation. version 0.1.0.0 2023-08-16 18:56:23 +00:00
LICENSE initial commit - not yet tested at all 2023-08-15 20:37:35 +00:00
README add to documentation. version 0.1.0.0 2023-08-16 18:56:23 +00:00
svhop-parsehost.go add copyright & license info to individual files 2023-08-17 12:57:28 +00:00
texts.go add copyright & license info to individual files 2023-08-17 12:57:28 +00:00
virthosts add copyright & license info to individual files 2023-08-17 12:57:28 +00:00

# 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