Method: Locd::Proxy.port

Defined in:
lib/locd/proxy.rb

.portFixnum

Get the proxy's port from it's .plist if it exists, otherwise from the config setting.

Returns:

  • (Fixnum)

    Port number.

Raises:

  • (TypeError)

    If we can't find a suitable config setting when looking for one.



236
237
238
239
240
241
242
# File 'lib/locd/proxy.rb', line 236

def self.port
  if proxy = Locd::Agent::Proxy.get
    proxy.port
  else
    Locd.config[:proxy, :port, type: t.pos_int]
  end
end