Modlishka is a reverse proxy designed for specific use cases. The main entrypoint initializes configuration, logging, plugins, and the core runtime before starting the server. The execution flow follows these steps:
- Parse configuration via
config.ParseConfiguration(). - Initialize logging based on
Debug and LogPostOnly flags. - Configure and enable plugins via
plugin.SetPluginRuntimeConfig and plugin.Enable. - Verify configuration requirements via
conf.VerifyConfiguration(). - Set up core and server runtime configurations.
- Prepare regexes via
runtime.MakeRegexes(). - Start the server using
core.RunServer().
// The main entrypoint executes the following sequence:
package main
func main() {
conf := Configuration{
config.ParseConfiguration(),
}
conf.initLogging()
plugin.SetPluginRuntimeConfig(conf.Options)
plugin.Enable(conf.Options)
conf.VerifyConfiguration()
runtime.SetCoreRuntimeConfig(conf.Options)
core.SetServerRuntimeConfig(conf.Options)
runtime.MakeRegexes()
core.RunServer()
}