View Source MainProxy.Proxy behaviour (main_proxy v0.3.1)
Summary
Types
@type scheme() :: :http | :https
Callbacks
@callback backends() :: [map()]
Specify the backends to pass requests to at startup time. (Optional)
Overriding this callback allows for setting the backends to be matched at runtime when the proxy is starting up.
Example:
@impl MainProxy.Proxy
def backends do
[
%{
domain: "https://myapp1.com",
phoenix_endpoint: MyApp1Web.Endpoint
},
%{
domain: "https://myapp2.com",
phoenix_endpoint: MyApp2Web.Endpoint
}
]
end
Merge cowboy config
Overriding this callback allows the configuration from the application environment to be modified at runtime.