Class: TCPSocket
- Inherits:
-
Object
- Object
- TCPSocket
- Extended by:
- Socksproxyable::ClassMethods
- Defined in:
- lib/socksify/tcpsocket.rb
Overview
monkey patch
Defined Under Namespace
Classes: SOCKSConnectionPeerAddress
Constant Summary
Constants included from Socksproxyable::ClassMethods
Socksproxyable::ClassMethods::SOCKS4_VERSIONS
Instance Attribute Summary collapse
-
#socks_peer ⇒ Object
readonly
Returns the value of attribute socks_peer.
Instance Method Summary collapse
-
#initialize(host = nil, port = nil, local_host = nil, local_port = nil, **kwargs) ⇒ TCPSocket
constructor
See tools.ietf.org/html/rfc1928 rubocop:disable Metrics/ParameterLists.
- #initialize_tcp ⇒ Object
Methods included from Socksproxyable::ClassMethods
socks_ignores=, socks_version, socks_version_hex
Methods included from Socksproxyable::InstanceMethodsConnect
#socks_connect, #socks_receive_reply
Methods included from Socksproxyable::InstanceMethodsAuthenticate
Constructor Details
#initialize(host = nil, port = nil, local_host = nil, local_port = nil, **kwargs) ⇒ TCPSocket
See tools.ietf.org/html/rfc1928 rubocop:disable Metrics/ParameterLists
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/socksify/tcpsocket.rb', line 17 def initialize(host = nil, port = nil, local_host = nil, local_port = nil, **kwargs) @socks_peer = host if host.is_a?(SOCKSConnectionPeerAddress) host = socks_peer.peer_host if socks_peer if socks_server && socks_port && !socks_ignores.include?(host) make_socks_connection(host, port, **kwargs) else make_direct_connection(host, port, local_host, local_port, **kwargs) end end |
Instance Attribute Details
#socks_peer ⇒ Object (readonly)
Returns the value of attribute socks_peer.
13 14 15 |
# File 'lib/socksify/tcpsocket.rb', line 13 def socks_peer @socks_peer end |
Instance Method Details
#initialize_tcp ⇒ Object
11 |
# File 'lib/socksify/tcpsocket.rb', line 11 alias initialize_tcp initialize |