Class: ReverseProxy::Server::Puma
- Defined in:
- lib/reverse_proxy/server/puma.rb
Instance Attribute Summary collapse
-
#default_bind ⇒ Object
readonly
Returns the value of attribute default_bind.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #binds ⇒ Object
- #binds=(binds) ⇒ Object
- #config ⇒ Object
-
#initialize(proxy) ⇒ Puma
constructor
A new instance of Puma.
- #socket ⇒ Object
Methods inherited from Generic
Methods included from Logger
Constructor Details
#initialize(proxy) ⇒ Puma
5 6 7 8 9 10 |
# File 'lib/reverse_proxy/server/puma.rb', line 5 def initialize proxy Bind::Formatter.add :puma, Proc.new {|data| "#{data.scheme}://#{data.data}"} @server = ::Puma @proxy = proxy @default_bind = 'tcp://0.0.0.0:9292' end |
Instance Attribute Details
#default_bind ⇒ Object (readonly)
Returns the value of attribute default_bind.
4 5 6 |
# File 'lib/reverse_proxy/server/puma.rb', line 4 def default_bind @default_bind end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
4 5 6 |
# File 'lib/reverse_proxy/server/puma.rb', line 4 def proxy @proxy end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
4 5 6 |
# File 'lib/reverse_proxy/server/puma.rb', line 4 def server @server end |
Instance Method Details
#binds ⇒ Object
17 18 19 |
# File 'lib/reverse_proxy/server/puma.rb', line 17 def binds ([] + config.[:binds]).compact end |
#binds=(binds) ⇒ Object
20 21 22 23 |
# File 'lib/reverse_proxy/server/puma.rb', line 20 def binds= binds config.[:binds] = binds log "#{name} listens at #{binds.empty? ? "default" : binds.join(", ")}" end |
#config ⇒ Object
11 12 13 |
# File 'lib/reverse_proxy/server/puma.rb', line 11 def config @server.cli_config end |
#socket ⇒ Object
14 15 16 |
# File 'lib/reverse_proxy/server/puma.rb', line 14 def socket @socket ||= Bind.new proxy.config.dir.join('puma.sock').to_s end |