lib/r_socks/config.rb in r_socks-0.1.8 vs lib/r_socks/config.rb in r_socks-0.2.0

- old
+ new

@@ -12,20 +12,32 @@ @store[:adaptor] end def auth_method=(method) if method == :no_auth - @store[:auth_method] = RSocks::NO_AUTH + @store[:auth_method] = :no_auth elsif method == :password - @store[:auth_method] = RSocks::PASSWORD_LOGIN - + @store[:auth_method] = :password else raise Error, "unknown auth method #{method}" end end def auth_method - @store[:auth_method] + @store[:auth_method] || :password + end + + def proxy_type=(type) + if type == :http + @store[:proxy_type] = :http + + elsif type == :socks5 + @store[:proxy_type] = :socks5 + end + end + + def proxy_type + @store[:proxy_type] || :socks5 end def proxy_buffer_size @store[:proxy_buffer_size] || 1024 * 1024 * 10 end \ No newline at end of file