class RSocks::Config

Public Class Methods

new() click to toggle source
# File lib/r_socks/config.rb, line 3
def initialize
  @store = {}
end

Public Instance Methods

auth_adaptor() click to toggle source
# File lib/r_socks/config.rb, line 11
def auth_adaptor
  @store[:adaptor]
end
auth_adaptor=(adaptor) click to toggle source
# File lib/r_socks/config.rb, line 7
def auth_adaptor=(adaptor)
  @store[:adaptor] = adaptor
end
auth_method() click to toggle source
# File lib/r_socks/config.rb, line 25
def auth_method
  @store[:auth_method] || :password
end
auth_method=(method) click to toggle source
# File lib/r_socks/config.rb, line 15
def auth_method=(method)
  if method == :no_auth
    @store[:auth_method] = :no_auth
  elsif method == :password
    @store[:auth_method] = :password
  else
    raise Error, "unknown auth method #{method}"
  end
end
enable_ssl=(value) click to toggle source
# File lib/r_socks/config.rb, line 74
def enable_ssl=(value)
  @store[:enable_ssl] = value
end
enable_ssl?() click to toggle source
# File lib/r_socks/config.rb, line 78
def enable_ssl?
  !!@store[:enable_ssl]
end
forward_addr() click to toggle source
# File lib/r_socks/config.rb, line 110
def forward_addr
  @store[:forward_addr]
end
forward_addr=(value) click to toggle source
# File lib/r_socks/config.rb, line 118
def forward_addr=(value)
  @store[:forward_addr] = value.to_s
end
forward_port() click to toggle source
# File lib/r_socks/config.rb, line 106
def forward_port
  @store[:forward_port]
end
forward_port=(value) click to toggle source
# File lib/r_socks/config.rb, line 114
def forward_port=(value)
  @store[:forward_port] = value.to_i
end
forward_server=(value) click to toggle source
# File lib/r_socks/config.rb, line 102
def forward_server=(value)
  @store[:forward_server] = value
end
forward_server?() click to toggle source
# File lib/r_socks/config.rb, line 98
def forward_server?
  @store[:forward_server] || false
end
forward_white_list() click to toggle source
# File lib/r_socks/config.rb, line 126
def forward_white_list
  @store[:white_list] || []
end
forward_white_list=(arr) click to toggle source
# File lib/r_socks/config.rb, line 122
def forward_white_list=(arr)
  @store[:white_list] = arr
end
health_check_route() click to toggle source
# File lib/r_socks/config.rb, line 54
def health_check_route
  @store[:health_check_route] || '/health'
end
health_check_route=(str) click to toggle source
# File lib/r_socks/config.rb, line 50
def health_check_route=(str)
  @store[:health_check_route] = str;
end
instances() click to toggle source
# File lib/r_socks/config.rb, line 86
def instances
  @store[:instance] || 1
end
instances=(number) click to toggle source
# File lib/r_socks/config.rb, line 82
def instances=(number)
  @store[:instance] = number
end
proxy_buffer_size() click to toggle source
# File lib/r_socks/config.rb, line 42
def proxy_buffer_size
  @store[:proxy_buffer_size] ||  1024 * 1024 * 10
end
proxy_buffer_size=(value) click to toggle source
# File lib/r_socks/config.rb, line 46
def proxy_buffer_size=(value)
  @store[:proxy_buffer_size] = value.to_i
end
proxy_type() click to toggle source
# File lib/r_socks/config.rb, line 38
def proxy_type
  @store[:proxy_type] || :socks5
end
proxy_type=(type) click to toggle source
# File lib/r_socks/config.rb, line 29
def proxy_type=(type)
  if type == :http
    @store[:proxy_type] = :http

  elsif type == :socks5
    @store[:proxy_type] = :socks5
  end
end
ssl_cert() click to toggle source
# File lib/r_socks/config.rb, line 70
def ssl_cert
  @store[:ssl_cert]
end
ssl_cert=(value) click to toggle source
# File lib/r_socks/config.rb, line 66
def ssl_cert=(value)
  @store[:ssl_cert] = value
end
ssl_private_key() click to toggle source
# File lib/r_socks/config.rb, line 62
def ssl_private_key
  @store[:ssl_private_key]
end
ssl_private_key=(value) click to toggle source
# File lib/r_socks/config.rb, line 58
def ssl_private_key=(value)
  @store[:ssl_private_key] = value
end
unbind_handler() click to toggle source
# File lib/r_socks/config.rb, line 94
def unbind_handler
  @store[:unbind_handler]
end
unbind_handler=(obj) click to toggle source
# File lib/r_socks/config.rb, line 90
def unbind_handler=(obj)
  @store[:unbind_handler] = obj
end