BuildAndTest

ODD-BOX

A simple to use cross-platform toy-level 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 own 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.

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)

By default, running odd-box without any arguments it will first try to read from odd-box.toml, then Config.toml. You can supply a custom config path using: ./odd-box "/tmp/my-file.toml"

Configuration format:

```toml

Global configuration

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" }, ]

Normal host

[[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"}, ]

Host a node based site

[[processes]] hostname = "noodle.local" path = "c:\temp" bin = "node" args = ["app.js"] envvars = []

Hosting an asp.net 4.8 based site behind IIS express

[[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"}, ]

```