class Falcon::Controller::Redirect

A controller for redirecting requests.

def endpoint

The endpoint the server will bind to.
def endpoint
	@command.endpoint.with(
		reuse_address: true,
	)
end

def initialize(command, **options)

@parameter command [Command::Redirect] The user-specified command-line options.
Initialize the redirect controller.
def initialize(command, **options)
	super(command, **options)
	
	@hosts = {}
end

def load_app

Load the {Middleware::Redirect} application with the specified hosts.
def load_app
	return Middleware::Redirect.new(Middleware::NotFound, @hosts, @command.redirect_endpoint)
end

def name

The name of the controller which is used for the process title.
def name
	"Falcon Redirect Server"
end

def start

Builds a map of host redirections.
def start
	configuration = @command.configuration
	
	services = Services.new(configuration)
	
	@hosts = {}
	
	services.each do |service|
		if service.is_a?(Service::Proxy)
			@hosts[service.authority] = service
		end
	end
	
	super
end