Class: Falcon::Command::Proxy
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Falcon::Command::Proxy
- Includes:
- Paths
- Defined in:
- lib/falcon/command/proxy.rb
Overview
Implements the `falcon proxy` command.
Manages a Falcon::Controller::Proxy instance which is responsible for proxing incoming requests.
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
One or more paths to the configuration files.
Instance Method Summary collapse
-
#call ⇒ Object
Prepare the environment and run the controller.
-
#container_class ⇒ Object
The container class to use.
-
#container_options ⇒ Object
Options for the container.
-
#controller ⇒ Object
Prepare a new controller for the command.
-
#endpoint(**options) ⇒ Object
The endpoint to bind to.
Methods included from Paths
#configuration, #resolved_paths
Instance Attribute Details
#paths ⇒ Object (readonly)
One or more paths to the configuration files.
47 |
# File 'lib/falcon/command/proxy.rb', line 47 many :paths |
Instance Method Details
#call ⇒ Object
Prepare the environment and run the controller.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/falcon/command/proxy.rb', line 68 def call Console.logger.info(self) do |buffer| buffer.puts "Falcon Proxy v#{VERSION} taking flight!" buffer.puts "- Binding to: #{@options[:bind]}" buffer.puts "- To terminate: Ctrl-C or kill #{Process.pid}" buffer.puts "- To reload: kill -HUP #{Process.pid}" end self.controller.run end |
#container_class ⇒ Object
The container class to use.
57 58 59 |
# File 'lib/falcon/command/proxy.rb', line 57 def container_class Async::Container.best_container_class end |
#container_options ⇒ Object
Options for the container. See Falcon::Controller::Serve#setup.
63 64 65 |
# File 'lib/falcon/command/proxy.rb', line 63 def {} end |
#controller ⇒ Object
Prepare a new controller for the command.
52 53 54 |
# File 'lib/falcon/command/proxy.rb', line 52 def controller Controller::Proxy.new(self) end |
#endpoint(**options) ⇒ Object
The endpoint to bind to.
80 81 82 |
# File 'lib/falcon/command/proxy.rb', line 80 def endpoint(**) Async::HTTP::Endpoint.parse(@options[:bind], timeout: @options[:timeout], **) end |