class Falcon::Command::Virtual
def bind_insecure
def bind_insecure @options[:bind_insecure] end
def bind_secure
def bind_secure @options[:bind_secure] end
def call
def call Async.logger.info(self) do |buffer| buffer.puts "Falcon Virtual v#{VERSION} taking flight!" buffer.puts "- To terminate: Ctrl-C or kill #{Process.pid}" buffer.puts "- To reload all sites: kill -HUP #{Process.pid}" end self.controller.run end
def controller
def controller Controller::Virtual.new(self) end
def host_endpoint(hostname, **options)
def host_endpoint(hostname, **options) endpoint = secure_endpoint(**options) url = URI.parse(@options[:bind_secure]) url.hostname = hostname return Async::HTTP::Endpoint.new(url, hostname: endpoint.hostname) end
def insecure_endpoint(**options)
def insecure_endpoint(**options) Async::HTTP::Endpoint.parse(@options[:bind_insecure], **options) end
def secure_endpoint(**options)
def secure_endpoint(**options) Async::HTTP::Endpoint.parse(@options[:bind_secure], **options) end