-module(ereproxy_config). -export([config/0, select_destination/1]). -include("ereproxy_config.hrl"). config() -> #cfg{listen = [{http, 80}, {https, 443}], ssl_opts = [{certfile, "example/cert.pem"}, {keyfile, "example/key.pem"}] }. %% select_destination select_destination(HostName) -> case lists:keysearch(HostName, 1, destination_list()) of {value, {HostName, Destination}} -> Destination; _UnknownHostName -> destination_default() end. destination_default() -> {"192.168.130.35", 80}. destination_list() -> [ {"code.sotun.de", {"192.168.130.103", 80}}, {"wave.sotun.de", {"192.168.130.111", 9898}} | [{WWW ++ "kraut" ++ Dash ++ "computing." ++ TLD, {"192.168.130.37", 80}} || WWW <- ["", "www."], Dash <- ["", "-"], TLD <- ["com", "de", "net", "eu", "org", "at"] ] ].