class Vines::Config::HttpPort

Public Class Methods

new(config, host='0.0.0.0', port=5280, &block) click to toggle source
Calls superclass method Vines::Config::Port::new
# File lib/vines/config/port.rb, line 77
def initialize(config, host='0.0.0.0', port=5280, &block)
  @stream = Vines::Stream::Http
  super(config, host, port, &block)
  defaults = {:root => File.expand_path('web'), :bind => '/xmpp'}
  @settings = defaults.merge(@settings)
end

Public Instance Methods

bind(url=nil) click to toggle source
# File lib/vines/config/port.rb, line 100
def bind(url=nil)
  if url
    @settings[:bind] = url
  else
    @settings[:bind]
  end
end
max_resources_per_account(max=nil) click to toggle source
# File lib/vines/config/port.rb, line 84
def max_resources_per_account(max=nil)
  if max
    @settings[:max_resources_per_account] = max
  else
    @settings[:max_resources_per_account]
  end
end
root(dir=nil) click to toggle source
# File lib/vines/config/port.rb, line 92
def root(dir=nil)
  if dir
    @settings[:root] = File.expand_path(dir)
  else
    @settings[:root]
  end
end
start() click to toggle source
Calls superclass method Vines::Config::Port#start
# File lib/vines/config/port.rb, line 117
def start
  super
  if config.cluster? && vroute.nil?
    log.warn("vroute sticky session cookie not set")
  end
end
vroute(id=nil) click to toggle source
# File lib/vines/config/port.rb, line 108
def vroute(id=nil)
  if id
    id = id.to_s.strip
    @settings[:vroute] = id.empty? ? nil : id
  else
    @settings[:vroute]
  end
end