A simple to use cross-platform reverse proxy server for local development and tinkering purposes.
It allows you to configure a list of processes to run and host them behind their custom hostnames.
Uses the 'port' environment variable to assign a port for each site. If your process does not support using the port environment variable, you can pass custom arguments or variables for your process instead.
Since this is not meant to be used in production, the proxy listens on port 80 (http), although the hosted sites can still use https.
You can enable or disable all sites or specific ones using the http://localhost/START and http://localhost/STOP endpoints, optionally using query parameter "?proc=my_site" to stop or start a specific site. (Mostly only useful for pre-build scripts where you dont want to manually stop and start the proxy on each rebuild. Sites start automatically again on the next request)
Configuration format:
```toml
rootdir = "c:\temp" # optional - can be used as a variable in process paths loglevel = "info" # trace,debug,info,warn,error portrangestart = 4200 # will start serving on 4200 and up 1 for each site defaultlogformat = "dotnet" # optional: "dotnet" or "standard" envvars = [ # can be overridden by site specific ones { key = "envvarforall_sites" , value = "nice" }, ]
[[processes]] hostname = "fun.local" path = "$rootdir\sites\fun" bin = "mysite.exe" args = ["/woohoo"] https = false # optional bool logformat = "standard" # optional - overrides defaultlogformat if defined envvars = [ { key = "sitespecificenvvar", value = "hello"}, ]
[[processes]] hostname = "noodle.local" path = "c:\temp" bin = "node" args = ["app.js"] envvars = []
[[processes]] hostname = "cool-site.local" path = "C:\Program Files\IIS Express" bin = "iisexpress.exe" args = [ "/path:c:\temp\cool-site", "/port:12345", "/hostname:127.0.0.1", "/trace:error"] envvars = [ # since port was configured in an arg, we need to also specify it here # to override the otherwise automatic port configuration { key = "port", value = "12345"}, ]
```