Class: SocksTunnel::Config
- Inherits:
-
Object
- Object
- SocksTunnel::Config
- Defined in:
- lib/socks_tunnel/config.rb
Class Attribute Summary collapse
-
.daemon ⇒ Object
Returns the value of attribute daemon.
-
.local_server_host ⇒ Object
Returns the value of attribute local_server_host.
-
.local_server_port ⇒ Object
Returns the value of attribute local_server_port.
-
.password ⇒ Object
Returns the value of attribute password.
-
.remote_server_host ⇒ Object
Returns the value of attribute remote_server_host.
-
.remote_server_port ⇒ Object
Returns the value of attribute remote_server_port.
-
.salt ⇒ Object
Returns the value of attribute salt.
Class Method Summary collapse
Class Attribute Details
.daemon ⇒ Object
Returns the value of attribute daemon.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def daemon @daemon end |
.local_server_host ⇒ Object
Returns the value of attribute local_server_host.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def local_server_host @local_server_host end |
.local_server_port ⇒ Object
Returns the value of attribute local_server_port.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def local_server_port @local_server_port end |
.password ⇒ Object
Returns the value of attribute password.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def password @password end |
.remote_server_host ⇒ Object
Returns the value of attribute remote_server_host.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def remote_server_host @remote_server_host end |
.remote_server_port ⇒ Object
Returns the value of attribute remote_server_port.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def remote_server_port @remote_server_port end |
.salt ⇒ Object
Returns the value of attribute salt.
4 5 6 |
# File 'lib/socks_tunnel/config.rb', line 4 def salt @salt end |
Class Method Details
.cipher ⇒ Object
32 33 34 |
# File 'lib/socks_tunnel/config.rb', line 32 def cipher @cipher ||= 'AES-256-CBC' end |
.daemon? ⇒ Boolean
36 37 38 |
# File 'lib/socks_tunnel/config.rb', line 36 def daemon? !!@daemon end |
.delimiter ⇒ Object
28 29 30 |
# File 'lib/socks_tunnel/config.rb', line 28 def delimiter @delimiter ||= '===SOCKSTUNNEL===' end |
.from(options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/socks_tunnel/config.rb', line 7 def from() if [:remote_addr] @local_server_port = [:port] @local_server_host = [:host] if [:host] @remote_server_host, @remote_server_port = [:remote_addr].split(':') else @remote_server_port = [:port] end @password = [:password] @salt = [:salt] if [:salt] @daemon = [:daemon] if [:daemon] end |