Module: Socksproxyable::ClassMethods

Included in:
TCPSocket
Defined in:
lib/socksify/socksproxyable.rb

Overview

class methods

Constant Summary collapse

SOCKS4_VERSIONS =
%w[4 4a].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#socks_passwordObject

Returns the value of attribute socks_password.



9
10
11
# File 'lib/socksify/socksproxyable.rb', line 9

def socks_password
  @socks_password
end

#socks_portObject

Returns the value of attribute socks_port.



9
10
11
# File 'lib/socksify/socksproxyable.rb', line 9

def socks_port
  @socks_port
end

#socks_serverObject

Returns the value of attribute socks_server.



9
10
11
# File 'lib/socksify/socksproxyable.rb', line 9

def socks_server
  @socks_server
end

#socks_usernameObject

Returns the value of attribute socks_username.



9
10
11
# File 'lib/socksify/socksproxyable.rb', line 9

def socks_username
  @socks_username
end

Instance Method Details

#socks_ignoresObject



15
16
17
# File 'lib/socksify/socksproxyable.rb', line 15

def socks_ignores
  @socks_ignores ||= %w[localhost]
end

#socks_ignores=(*hosts) ⇒ Object



19
20
21
# File 'lib/socksify/socksproxyable.rb', line 19

def socks_ignores=(*hosts)
  @socks_ignores = hosts
end

#socks_versionObject



11
12
13
# File 'lib/socksify/socksproxyable.rb', line 11

def socks_version
  @socks_version ||= '5'
end

#socks_version_hexObject



23
24
25
# File 'lib/socksify/socksproxyable.rb', line 23

def socks_version_hex
  SOCKS4_VERSIONS.include?(socks_version) ? "\004" : "\005"
end